Hi, I''ve installed puppet gem on freebsd 6.1 and wrote a simple startup script for puppetmasterd. It starts fine, but doesn''t create the pidfile, so I can''t stop it. Here is my script: #!/bin/sh utility_enable=${utility_enable-"NO"} utility_flags=${utility_flags-""} utility_pidfile=${utility_pidfile-"/var/run/puppetmasterd.pid"} . /etc/rc.subr name="puppetmasterd" rcvar=`set_rcvar` command="/usr/local/bin/puppetmasterd" load_rc_config $name pidfile="${utility_pidfile}" start_cmd="echo \"Starting ${name}.\"; /usr/bin/nice -5 ${command} ${utility_flags} ${command_args}" run_rc_command "$1" and I have puppetmasterd_enable="YES" set in /etc/rc.conf My script is based on a standard template from the freebsd handbook (11.5.1): http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/configtuning-starting-services.html When I try to stop it i get: puppetmasterd not running? (check /var/run/puppetmasterd.pid). the pid file doesn''t exist but puppetmasterd is running fine. Cheers, -- jedrek
jedrek wrote:> Hi, > I''ve installed puppet gem on freebsd 6.1 and wrote a simple startup > script for puppetmasterd. It starts fine, but doesn''t create the > pidfile, so I can''t stop it. Here is my script: > [SNIP] > > When I try to stop it i get: > puppetmasterd not running? (check /var/run/puppetmasterd.pid). > > the pid file doesn''t exist but puppetmasterd is running fine.Are you sure you''re checking in the right place? The default location (at least for now) of the puppetmasterd pid file is /var/puppet/run/puppetmasterd.pid. Unless you''ve changed it in the config, that''s where you should be looking. If you start puppetmasterd in verbose mode (with -v), it should say: info: Creating PID file to /var/puppet/run/puppetmasterd.pid -- Most people are born and years later die without really having lived at all. They play it safe and tiptoe through life with no aspiration other than to arrive at death safely. -- Tony Campolo, "Carpe Diem" --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
Luke Kanies wrote:> Are you sure you''re checking in the right place? The default location > (at least for now) of the puppetmasterd pid file is > /var/puppet/run/puppetmasterd.pid. Unless you''ve changed it in the > config, that''s where you should be looking. > > If you start puppetmasterd in verbose mode (with -v), it should say: > > info: Creating PID file to /var/puppet/run/puppetmasterd.pid >With a little fiddle, this is the working script: #!/bin/sh # # PROVIDE: puppetmasterd # REQUIRE: DAEMON # KEYWORD: shutdown # # DO NOT CHANGE THESE DEFAULT VALUES HERE # SET THEM IN THE /etc/rc.conf FILE # utility_enable=${utility_enable-"NO"} utility_flags=${utility_flags-""} utility_pidfile=${utility_pidfile-"/var/puppet/run/puppetmasterd.pid"} . /etc/rc.subr name="puppetmasterd" rcvar=`set_rcvar` command="/usr/local/bin/puppetmasterd" load_rc_config $name pidfile="${utility_pidfile}" extra_commands="restart" start_cmd="echo \"Starting ${name}.\"; ${command} ${utility_flags} ${command_args}" if [ "$1" = stop ] || [ "$1" = restart ]; then stop_cmd="echo \"Stopping ${name}.\"; kill `cat $pidfile`" else fi run_rc_command "$1" Thanks your help Luke. -- Jedrek
imagine the gem install of puppet if it could detect the OS with facter and automaticaly install the startupscript for the OS it is on !! could be awesome no ? we have it for: gentoo freebsd redhat debian ... seems interesting for a ''universal'' package eheh. Cordialement, Ghislain _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
Maybe Matching Threads
- How to get djbdns to start early enough to satisfy ntpd at boot?
- Re: Ubuntu 16.04 libvirt-guests.sh [6917] - running guests under URI address default: no running guests
- Re: Ubuntu 16.04 libvirt-guests.sh [6917] - running guests under URI address default: no running guests
- Re: Ubuntu 16.04 libvirt-guests.sh [6917] - running guests under URI address default: no running guests
- Re: Ubuntu 16.04 libvirt-guests.sh [6917] - running guests under URI address default: no running guests