The CentOS 6.5 test found that sudo is not available in rc.local and can be used with the SU
However, there is a precondition that the specified user can not set up a home directory, but must be able to log in
[Email protected] ~]# vim/etc/rc.local
#!/bin/sh
#
# This script is executed *after* all and the other init scripts.
# can put your own initialization stuff in here if you don ' t
# want to does the full Sys V style init stuff.
/bin/su-svn-c "Svnserve-d-r/application/svndata/"
After reboot
[Email protected] ~]# Ps-ef|grep SVN
SVN 1561 1 0 11:52? 00:00:00 svnserve-d-r/application/svndata/
Root 1603 1583 0 11:53 pts/0 00:00:00 grep svn
Some users of the notes are used in Su <user> this form (less a-number), in fact, can also be started, but whether the use of-number or some areas
No-No.
[[email protected] ~]# su svn
[[email protected] root]$ echo $PATH
/application/mysql/bin:/application/mysql/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/ Bin:/usr/sbin:/usr/bin:/root/bin
Band-No.
[Email protected] ~]# SU-SVN
[Email protected] ~]$ echo $PATH
/application/mysql/bin:/application/mysql/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/ Local/sbin:/usr/sbin:/sbin:/home/svn/bin
Path paths are different, and only a minus sign is a complete switch identity.
Rc.local specify user to run program