[CentOS] creating script for init.d

Mon Dec 18 19:27:27 UTC 2006
Michael Velez <mikev777 at hotmail.com>


> -----Original Message-----
> From: centos-bounces at centos.org 
> [mailto:centos-bounces at centos.org] On Behalf Of Linux Man
> Sent: Sunday, December 17, 2006 8:30 PM
> To: centos at centos.org
> Subject: [CentOS] creating script for init.d
> Hello.
> I'm moving from a very old Fedora Core 1 to CentOS 4.4, what 
> a change!!
> Three year ago, I wrote some script (network related) and 
> worked very well. Now, I can put into init.d by means of 
> chkconfig and I restarted the system, but always hang when 
> executing my srcipt (in my new centos 4.4 ).
> There a manual for making scripts for init.d?
> there is some new requirement by which it does not work anymore?
> Thanks a lots!!!!

Are you using the 'su' command in your script?

This happenned to me when I moved to RHEL4/Centos 4.  My problem was due to
SELinux.  I was using the 'su' command.  When I changed it to use the
'runuser' command instead, it worked fine.  The reason it was hanging for me
is that using the su command produces a context question on the console
(during password checking) for which I had to press enter.  With 'runuser',
you don't get the SELinux context question.