Hobbit startup script.
Hi,
I understand that hobbit needs to run as the hobbit user, but it is a bit annoying to have the hobbit startup script require the hobbit user to run it.
When I want to run it automagically out of /etc/init.d I have to change the script to not check for hobbit and then do an su to the hobbit user thus:
su -c "/home/xymon/server/bin/hobbitlaunch --config=/home/xymon/server/etc/hobbitlaunch.cfg --env=/home/xymon/server/etc/hob
bitserver.cfg --log=/var/log/xymon/hobbitlaunch.log --pidfile=/var/log/xymon/hobbitlaunch.pid"
why is it done this way rather than as above, thus allowing the server to start out of init.d?
On Friday 05 June 2009 12:09:00 David Peters wrote:
Hi,
I understand that hobbit needs to run as the hobbit user, but it is a bit annoying to have the hobbit startup script require the hobbit user to run it.
I don't quite understand the second part of your statement above ...
When I want to run it automagically out of /etc/init.d I have to change the script to not check for hobbit and then do an su to the hobbit user thus:
su -c "/home/xymon/server/bin/hobbitlaunch --config=/home/xymon/server/etc/hobbitlaunch.cfg --env=/home/xymon/server/etc/hob
bitserver.cfg --log=/var/log/xymon/hobbitlaunch.log --pidfile=/var/log/xymon/hobbitlaunch.pid"
Which script are you referring to here? The "runclient.sh" script ?
why is it done this way rather than as above, thus allowing the server to start out of init.d?
Have you looked at (e.g.) rpm/hobbit-init.d and debian/hobbit.init in the source distribution ? They basically run 'su - hobbit runclient.sh ...', and are suitable for use from /etc/init.d
Of course, the next question I have is, what Unix or Linux distribution are you on, and why didn't you install from packages (which would have avoided you worrying about this in the first place).
Regards, Buchan
I am running on Solaris, and I am testing 4.3.0 which is why I am not using rpm's etc.
-----Original Message----- From: Buchan Milne [mailto:bgmilne at staff.telkomsa.net] Sent: Friday, 5 June 2009 8:30 PM To: hobbit at hswn.dk Cc: David Peters Subject: Re: [hobbit] Hobbit startup script.
On Friday 05 June 2009 12:09:00 David Peters wrote:
Hi,
I understand that hobbit needs to run as the hobbit user, but it is a bit annoying to have the hobbit startup script require the hobbit user to run it.
I don't quite understand the second part of your statement above ...
When I want to run it automagically out of /etc/init.d I have to change the script to not check for hobbit and then do an su to the hobbit user thus:
su -c "/home/xymon/server/bin/hobbitlaunch --config=/home/xymon/server/etc/hobbitlaunch.cfg --env=/home/xymon/server/etc/hob
bitserver.cfg --log=/var/log/xymon/hobbitlaunch.log --pidfile=/var/log/xymon/hobbitlaunch.pid"
Which script are you referring to here? The "runclient.sh" script ?
why is it done this way rather than as above, thus allowing the server to start out of init.d?
Have you looked at (e.g.) rpm/hobbit-init.d and debian/hobbit.init in the source distribution ? They basically run 'su - hobbit runclient.sh ...', and
are suitable for use from /etc/init.d
Of course, the next question I have is, what Unix or Linux distribution are you on, and why didn't you install from packages (which would have avoided you worrying about this in the first place).
Regards, Buchan
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
I do get your answer though. There should be a script for the OS I am on that calls runclient.sh and does the su there, not inside the runclient script.
-----Original Message----- From: Buchan Milne [mailto:bgmilne at staff.telkomsa.net] Sent: Friday, 5 June 2009 8:30 PM To: hobbit at hswn.dk Cc: David Peters Subject: Re: [hobbit] Hobbit startup script.
On Friday 05 June 2009 12:09:00 David Peters wrote:
Hi,
I understand that hobbit needs to run as the hobbit user, but it is a bit annoying to have the hobbit startup script require the hobbit user to run it.
I don't quite understand the second part of your statement above ...
When I want to run it automagically out of /etc/init.d I have to change the script to not check for hobbit and then do an su to the hobbit user thus:
su -c "/home/xymon/server/bin/hobbitlaunch --config=/home/xymon/server/etc/hobbitlaunch.cfg --env=/home/xymon/server/etc/hob
bitserver.cfg --log=/var/log/xymon/hobbitlaunch.log --pidfile=/var/log/xymon/hobbitlaunch.pid"
Which script are you referring to here? The "runclient.sh" script ?
why is it done this way rather than as above, thus allowing the server to start out of init.d?
Have you looked at (e.g.) rpm/hobbit-init.d and debian/hobbit.init in the source distribution ? They basically run 'su - hobbit runclient.sh ...', and
are suitable for use from /etc/init.d
Of course, the next question I have is, what Unix or Linux distribution are you on, and why didn't you install from packages (which would have avoided you worrying about this in the first place).
Regards, Buchan
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
On Friday 05 June 2009 12:44:24 David Peters wrote:
I do get your answer though. There should be a script for the OS I am on that calls runclient.sh and does the su there, not inside the runclient script.
Yes, such as either of the two script shipped in the source distribution. While they are in "debian" and "rpm" directories, they are not very specific to each distribution. If you are on Solaris 10, someone has created an SMF script ...
Yes, you should not be using the runclient.sh script to start the service at boot etc.
Regards, Buchan
Sorry, I am referring to the server startup script. All I do atm is copy the /home/xymon/server/hobbit.sh script and make the modifications as per below. I just wonder however why the script requires to be run as hobbit. I have changed the script as per my instructions and it has been running fine for a couple of years now.
-----Original Message----- From: Buchan Milne [mailto:bgmilne at staff.telkomsa.net] Sent: Saturday, 6 June 2009 12:16 AM To: hobbit at hswn.dk Cc: David Peters Subject: Re: [hobbit] Hobbit startup script.
On Friday 05 June 2009 12:44:24 David Peters wrote:
I do get your answer though. There should be a script for the OS I am on that calls runclient.sh and does the su there, not inside the runclient script.
Yes, such as either of the two script shipped in the source distribution. While they are in "debian" and "rpm" directories, they are not very specific to each distribution. If you are on Solaris 10, someone has created an SMF script ...
Yes, you should not be using the runclient.sh script to start the service at
boot etc.
Regards, Buchan
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
-----Original Message----- From: David Peters [mailto:davidp at electronf.com] Sent: Friday, June 05, 2009 4:02 PM To: hobbit at hswn.dk Subject: RE: [hobbit] Hobbit startup script.
Sorry, I am referring to the server startup script. All I do atm is copy the /home/xymon/server/hobbit.sh script and make the modifications as per below. I just wonder however why the script requires to be run as hobbit. I have changed the script as per my instructions and it has been running fine for a couple of years now.
Attached is a version of the hobbit/xymon init script I use. The package we have performs a bunch of substitutions on this to get it to conform to other changes, so it may not work out of the box for you. This should give you at least an idea of one way to do it, though.
Regards, Japheth Cleaver
Sorry I wasn't asking how to do it, just why the script has to run as hobbit when you install out of the box.
David Peters
+61 2 63913565 +61 4 17863572
From: "Cleaver, Japheth" <jcleaver at soe.sony.com> To: <hobbit at hswn.dk> Date: 09/06/2009 02:06 AM Subject: RE: [hobbit] Hobbit startup script.
-----Original Message----- From: David Peters [mailto:davidp at electronf.com] Sent: Friday, June 05, 2009 4:02 PM To: hobbit at hswn.dk Subject: RE: [hobbit] Hobbit startup script.
Sorry, I am referring to the server startup script. All I do atm is copy the /home/xymon/server/hobbit.sh script and make the modifications as per below. I just wonder however why the script requires to be run as hobbit. I have changed the script as per my instructions and it has been running fine for a couple of years now.
Attached is a version of the hobbit/xymon init script I use. The package we have performs a bunch of substitutions on this to get it to conform to other changes, so it may not work out of the box for you. This should give you at least an idea of one way to do it, though.
Regards, Japheth Cleaver [attachment "hobbit.initscript.fedora.txt" deleted by David Peters/DPI/NSW] To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
This message is intended for the addressee named and may contain confidential information. If you are not the intended recipient, please delete it and notify the sender. Views expressed in this message are those of the individual sender, and are not necessarily the views of their organisation.
From: Buchan Milne [mailto:bgmilne at staff.telkomsa.net] each distribution. If you are on Solaris 10, someone has created an SMF script
As if by magic...
<?xml version='1.0'?> <!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'> <service_bundle type='manifest' name='export'> <service name='site/hobbit-server' type='service' version='0'> <create_default_instance enabled='true'/> <dependency name='filesystem' grouping='require_all' restart_on='none' type='service'> <service_fmri value='svc:/system/filesystem/local'/> </dependency> <dependency name='multi-user-server' grouping='optional_all' restart_on='none' type='service'> <service_fmri value='svc:/milestone/multi-user-server'/> </dependency> <dependency name='hobbitserver_file' grouping='require_all' restart_on='none' type='path'> <service_fmri value='file://localhost/opt/hobbit/server/etc/hobbitserver.cfg'/> </dependency> <dependency name='bbhosts_file' grouping='require_all' restart_on='none' type='path'> <service_fmri value='file://localhost/opt/hobbit/server/etc/bb-hosts'/> </dependency> <exec_method name='start' type='method' exec='/opt/hobbit/server/hobbit.sh start' timeout_seconds='30'> <method_context> <method_credential user='hobbit'/> </method_context> </exec_method> <exec_method name='stop' type='method' exec='/opt/hobbit/server/hobbit.sh stop' timeout_seconds='30'> <method_context> <method_credential user='hobbit'/> </method_context> </exec_method> <exec_method name='refresh' type='method' exec='/opt/hobbit/server/hobbit.sh restart' timeout_seconds='30'> <method_context> <method_credential user='hobbit'/> </method_context> </exec_method> <property_group name='startd' type='framework'> <propval name='ignore_error' type='astring' value='core,signal'/> </property_group> <stability value='Unstable'/> <template> <common_name> <loctext xml:lang='C'>Hobbit Monitor Server</loctext> </common_name> <documentation> <doc_link name='hobbit_monitor_site' uri='http://hobbitmon.sourceforge.net/'/> </documentation> </template> </service> </service_bundle>
Don't remember where this one came from but it will be one of my head or another person in this distribution group.
|\/|artin
The message is intended for the named addressee only and may not be disclosed to or used by anyone else, nor may it be copied in any way.
The contents of this message and its attachments are confidential and may also be subject to legal privilege. If you are not the named addressee and/or have received this message in error, please advise us by e-mailing security at colt.net and delete the message and any attachments without retaining any copies.
Internet communications are not secure and COLT does not accept responsibility for this message, its contents nor responsibility for any viruses.
No contracts can be created or varied on behalf of COLT Telecommunications, its subsidiaries or affiliates ("COLT") and any other party by email Communications unless expressly agreed in writing with such other party.
Please note that incoming emails will be automatically scanned to eliminate potential viruses and unsolicited promotional emails. For more information refer to www.colt.net or contact us on +44(0)20 7390 3900.
-----Original Message----- From: Ward, Martin [mailto:Martin.Ward at colt.net] Sent: Dienstag, 9. Juni 2009 10:35 To: hobbit at hswn.dk Subject: RE: [hobbit] Hobbit startup script.
From: Buchan Milne [mailto:bgmilne at staff.telkomsa.net] each distribution. If you are on Solaris 10, someone has created an SMF script
As if by magic...
There is a very good "How-to" on The Shire done by Galen Johnson about Solaris 10 Xymon SMF.
Look here: http://xymonton.trantor.org/doku.php/addons:hobbitsmf
Johann
Find something simple (like the syslog startup script) and hack it into a xymon startup script. For the start command, "su - hobbit -c <wherever>runclient.sh".
Here is an example that I use:
#!/sbin/sh
Greg Hubbard, EDS, January 2006
Made from Solaris syslog startup script
BBHOME=/app/hobbit/client; export BBHOME
BBUSER=xymon; export BBUSER
HOST="uname -n.domain.com"
case "$1" in 'start') if [ -f $BBHOME/runclient.sh ]; then echo 'Hobbit client starting.' # su - $BBUSER -c "cd $BBHOME; ./runclient.sh --hostname=$HOST start" fi ;;
'stop') if [ -f $BBHOME/runclient.sh ]; then
su - $BBUSER -c "cd $BBHOME; ./runclient.sh stop"
fi
;;
*) echo "Usage: $0 { start | stop }" exit 1 ;; esac This is for a client. The server startup is similar, except it runs the server startup script. This is not the most clever or elaborate of scripts, but it does work for me.
From: David Peters [mailto:davidp at electronf.com] Sent: Friday, June 05, 2009 5:09 AM To: hobbit at hswn.dk Subject: [hobbit] Hobbit startup script.
Hi,
I understand that hobbit needs to run as the hobbit user, but it is a bit annoying to have the hobbit startup script require the hobbit user to run it.
When I want to run it automagically out of /etc/init.d I have to change the script to not check for hobbit and then do an su to the hobbit user thus:
su -c "/home/xymon/server/bin/hobbitlaunch --config=/home/xymon/server/etc/hobbitlaunch.cfg --env=/home/xymon/server/etc/hob bitserver.cfg --log=/var/log/xymon/hobbitlaunch.log --pidfile=/var/log/xymon/hobbitlaunch.pid"
why is it done this way rather than as above, thus allowing the server to start out of init.d?
participants (7)
-
bgmilne@staff.telkomsa.net
-
david.peters@dpi.nsw.gov.au
-
davidp@electronf.com
-
ghubbard@hp.com
-
jcleaver@soe.sony.com
-
Johann.Eggers@teleatlas.com
-
Martin.Ward@colt.net