Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a VM running under Fedora OS. That VM has four users lets say(A, B, C, D). That VM has one process running under each user. So when that VM is rebooted, what should I do so that those process auto starts under respective user.

Provided that

a is the custom command to start a process under A user

b is the custom command to start a process under B user

c is the custom command to start a process under C user

d is the custom command to start a process under D user

a,b,c,d are the commands that are not available to root user. They are only available to respective users.


share|improve this question

Create a separate Systemd init script for the processes. For process A create the file /etc/systemd/system/A.service and add something like this to it:

Description=Process A

ExecStart=/some/command/to/run --arg1 --arg2


Customize this as you like (Restart, StartLimitInterval, StartLimitBurst, etc...)

Then enable it with

systemctl enable A.service

and start

systemctl start A.service
share|improve this answer
I must spin up a fedora vm and start learning systemd, it's heading my way in a future EL release. – Iain Jul 31 '13 at 7:47
Systemd is a great thing, I use it everywhere since Arch switched to it. – Stone Jul 31 '13 at 7:50
@stone: Do I need to make separate service file for four users? – Gagan Jul 31 '13 at 7:54
Yes, this is the cleanest way to do this. – Stone Jul 31 '13 at 8:06
@stone: Fedora 18 says systemctl: command not found. Have I forgot something to install so that systemctl command can be found. – Gagan Jul 31 '13 at 8:11

Can you use the /etc/crontab and the @reboot time. The format of the /etc/crontab takes a username after the time specification and the process is run as that user.

@reboot A /path/to/a
@reboot B /path/tob

and so on.

share|improve this answer
All I want is that the process must be started whenever the server boots. Will it be possible with your answer? – Gagan Jul 31 '13 at 7:45
@Gagan: Why not test it and see ? – Iain Jul 31 '13 at 7:45
@lain: What should I replace reboot with? Is reboot some kind of special variable that crontab recognize? – Gagan Jul 31 '13 at 7:53
@lain: I have added reboot <username> <command> to crontab file but after reboot it didn't start the process. reboot has at sign infront of it. – Gagan Jul 31 '13 at 8:07
Its a special variable, you don't need to replace it. – Stone Jul 31 '13 at 8:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.