Re: backgrounding a su process...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11:48 24 Nov 2003, Timothy Stone <citylists@xxxxxxxxxxxxxx> wrote:
| Should I quote the command passed to su when backgrounding a process as 
| a low-privileged user? For example:
| 
| ...some important setup code...
| su - nobody -c /path/to/script/run/as/nobody &
| 
| OR
| 
| su - nobody -c "/path/to/script/run/as/nobody &"
| 
| OR EVEN
| 
| su - nobody -c (/path/to/script/run/as/nobody &)

The quoting you need has nothing to do with it being backgrounded - it will
be the same backgrounded or not.

In general, the command passed with su is handed to the shell of the user.
That shell will be parsing the command afresh, so everything in it must
reach it intact, and so you usually want single quotes around the command:

	su - nobody -c 'command here'
    or
	su - nobody -c 'command here' &

Cheers,
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

The most annoying thing about being without my files after our disc crash was
discovering once again how widespread BLINK was on the web.


-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux