Re: init.d startup script

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

 



Al Sparks wrote:
> This is a small thing, but it's bothering me.
> 
> I've got a startup script placed in /etc/init.d that starts up Xvfb for
> me.  I basically used the /etc/init.d/sendmail startup as a template.
> 
>    start() {
>           
>           # Start daemons.
>           echo -n $"Starting $prog: "
>           daemon Xvfb :1 -screen 0 6x6x8 -fp /usr/lib/X11/fonts/misc &
>           RETVAL=0
>           echo
>           return $RETVAL
>   }
> 
> When I run 
>    # service Xvfb start
> 
> I get "Starting Xvfb" w/o the "[ OK  ]" at the end of the line.  But
> Xvfb does start up.
> 
> Also, when I do a 
>   # ps -Ao "%u %p %P %a" | grep Xvfb
>   root      1528     1 /bin/bash /etc/init.d/Xvfb start
>   root      1529  1528 initlog -q -c Xvfb :1 -screen 0 6x6x8 -fp /usr/lib/X11/fonts/misc
>   root      1530  1529 Xvfb :1 -screen 0 6x6x8 -fp /usr/lib/X11/fonts/misc
> 
> Now when I run the same startup without the "daemon" in front of the
> program name, I get 
> 
>   # ps -Ao "%u %p %P %a" | grep Xvfb
>   root      1583     1 Xvfb :1 -screen 0 6x6x8 -fp /usr/lib/X11/fonts/misc
> 
> which seems more reasonable.
> 
> 
> Since I can get the script to startup what I want to start up, it's not
> a big deal.  I'm only doing this for aesthetics.  But still...
>    === Al
> 
You should probably read the sysvinitfiles file in the initscripts
docs. It explains how to write the startup scripts. One thing to
keep in mind is that if you background the program by putting & at
the end of the command line, then RETVAL is not valid, so the
[ OK ] is meaningless. Can Xvfb put itself in the daemon mode?
If there is an option to do that, it is better then using &.

Mikkel
-- 

  Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux