You are not logged in.

#1 2009-08-07 04:39:16

tpolich
Member
Registered: 2009-08-07
Posts: 44

[SOLVED] Start process or script as a non root user on boot

This is my first time posting here, I installed arch last week and have been able to firgure almost everything out. The wiki pages (very well written) and the forums have been a big help. However this is one question that I haven't been able to find the answer to.

"How do I start a process or script as a user other then root at boot?"

My guess is my inability to find an answer is mostly from my relitivly small understanding of bash scripting. If someone could point me to a guide or write down an example themselves I would greatly apriceate it.

Thank you,

Tim



Edit: spelling

Last edited by tpolich (2009-08-07 05:26:36)

Offline

#2 2009-08-07 04:43:33

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: [SOLVED] Start process or script as a non root user on boot

su -l -c "some-command-or-other" username
in /etc/rc.local

Offline

#3 2009-08-07 04:49:14

tpolich
Member
Registered: 2009-08-07
Posts: 44

Re: [SOLVED] Start process or script as a non root user on boot

wow, I feel kind of silly now. Thank you for the fast response. I can't belive I forgot about the su command, I came from ubuntu and never really had a need for it just used sudo.

One more quick question, is rc.local run the backround or say if I asked for input would the system boot hang?

Offline

#4 2009-08-07 06:52:51

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: [SOLVED] Start process or script as a non root user on boot

tpolich wrote:

One more quick question, is rc.local run the backround or say if I asked for input would the system boot hang?

Yes, rc.local itself would hang, but if you background the process inside rc.local using the '&' symbol at the end of the command, then that command will be backgrounded and rc.local can continue.

Offline

#5 2009-08-07 07:59:36

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: [SOLVED] Start process or script as a non root user on boot

"Hang" could be misleading. I believe that input would be requested, and could be provided. So yes, it would hang in the sense of wait for input. It wouldn't crash or get into a state from which it could't continue (after input is provided). You could also put a timeout on your "read" command.

Offline

#6 2009-08-07 11:05:09

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: [SOLVED] Start process or script as a non root user on boot

Yes, true... I was thinking 'hang' as in stop processing pending that input. Good point through smile

Offline

Board footer

Powered by FluxBB