[opensuse] S99 startup script
Hi list, A commersial CAD application has available a S99 startup script to automatic restart a license server after reboot of the Linux system. Where should this S99 script be located on SLES10 and possibly how to activate it? I've tried to save the S99 script in /etc/init.d/rc2.d but this didn't restart the license server. Possibly how to activate it in addition? Thanks, Terje J. Hanssen -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Tue, 24 Jun 2008 00:53:52 +0200, Terje J. Hanssen wrote:
A commersial CAD application has available a S99 startup script to automatic restart a license server after reboot of the Linux system. Where should this S99 script be located on SLES10 and possibly how to activate it?
Nowhere :) Init scripts belong to /etc/init.d, have the name of the service they start and *must* have an LSB conforming header (see /etc/init.d/skeleton for an example). Set # Required-Start: $ALL to have the script run after anything else. After that call insserv to create the appropriate runlevel links. See 'man insserv' and 'man init.d' for further information. Philipp -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Tuesday 2008-06-24 at 00:53 +0200, Terje J. Hanssen wrote:
A commersial CAD application has available a S99 startup script to automatic restart a license server after reboot of the Linux system. Where should this S99 script be located on SLES10 and possibly how to activate it?
Nowhere. Impossible.
I've tried to save the S99 script in /etc/init.d/rc2.d but this didn't restart the license server. Possibly how to activate it in addition?
That method is not conformant to the methods used on suse to start/stop services automatically and will not work. Ask your vendor to provide a script compatible with suse. For details and explanations, read the archive, we had a long talk about this not even a week ago. Either you edit and adapt that script, or create another conformant script that in turn calls their script. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) iD8DBQFIYEg4tTMYHG2NR9URAmxPAJ99mKprAlVFVC8nlN3G4V2POIOvUQCeKKGo EyoKlLLnpJtWqiR48wYy3xw= =JAXf -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
----- Original Message -----
From: "Terje J. Hanssen"
Hi list,
A commersial CAD application has available a S99 startup script to automatic restart a license server after reboot of the Linux system. Where should this S99 script be located on SLES10 and possibly how to activate it?
I've tried to save the S99 script in /etc/init.d/rc2.d but this didn't restart the license server. Possibly how to activate it in addition?
Look in your /etc/inittab for these lines near the top (after the big block of comments) # The default runlevel is defined here id:3:initdefault: What number is in your file where mine has :3: ? Probably 3 or 5. Assuming you have a 5 there (since that's the default unless you installed the text-only minimal system) In that case you would need to put it in /etc/init.d/rc5.d You could stop there and most sensible people with better things to do with their lives probably would... But if you're stupid like me and are willing to waste 2 hours just to get the new service to say "starting ... [DONE]" in green text and all official looking like all the other ones, then the more correct way is to modify the script into a suse style script and place it in /etc/init.d without any S99 in it's name. Then suse will manage placing the symlinks with S## and K## in all the appropriate places, and it will be all nicely integrated with suse and yast just like the rest of the services. Let's say the app is called CadKey and the license manager daemon is called cklmd. ( I know there is, or used to be, a cad app called cadkey, I have no idea if they have a linux version or if they have a license daemon or what it's name might be. This is just an example. ) Creat the following file: vi /etc/init.d/cklmd ----------------top------------------ #!/bin/sh # # /etc/init.d/cklmd # # CadKey license manager daemon startup. # ### BEGIN INIT INFO # Provides: cklmd # Should-Start: $ALL # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Description: cklmd is the license manager daemon for CadKey. ### END INIT INFO EXE=/path/to/cklmd DESC="CadKey License Manager" . /etc/rc.status rc_reset return=$rc_done case "$1" in start) checkproc $EXE && { echo -en "\n$DESC is already running." rc_status -s } || { echo -n 'Starting $DESC:' startproc -q $EXE rc_status -v } ;; stop) echo -n 'Stopping $DESC:' killproc -TERM $EXE rc_status -v ;; restart|reload) $0 stop $0 start rc_status ;; status) checkproc $EXE rc_status -v ;; *) echo "Usage: $0 {start|stop|restart|status}" exit 1 ;; esac rc_exit ---------------------end---------------------- Edit the EXE= line. Put the full path and filename of the license manager executable Edit the DESC= line. Put a suitable descriptive string that will be embedded in messages. Then chmod 755 /etc/init.d/cklmd Then ln -s /etc/init.d/cklmd /sbin/rccklmd Then run "insserv cklmd" At this point you have a new service called "cklmd" that can be enabled/disabled/started/stopped and found within yast just like all the other services. Now, to enable it so that it starts at boot in runlevels 3 and 5 (specified via the specially formatted comments in the script above) you run "chkconfig cklmd on" or you can go into yast and find it in the list of other services and toggle it on/off. Now you can reboot and the license daemon should be running after the reboot, and/or you can start the daemon manually without rebooting the same way as most other services, by running "rc<servicename> <action>". So: to start: rccklmd start to stop: rccklmd stop to check if it's up or down at the moment: rccklmd status The script above is of course a minimal example/sample. It should work just as it is if the license daemon is a simple program that just needs to be run without any other special steps or actions. Some daemons require lockfiles or pid files or config files or environment variables or named pipes (fifos) or device nodes or other daemon processes or special user accounts etc etc etc to be set up in order to run. All such actions will be in the S99 script they provided and you would have to replicate them in this script in the start) and stop) sections, most likely just before the startproc and killproc lines. Good luck -- Brian K. White brian@aljex.com http://www.myspace.com/KEYofR +++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++. filePro BBx Linux SCO FreeBSD #callahans Satriani Filk! -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Monday 2008-06-30 at 21:20 -0400, Brian K. White wrote: ...
Assuming you have a 5 there (since that's the default unless you installed the text-only minimal system)
In that case you would need to put it in /etc/init.d/rc5.d
Where Yast will delete it the next time it does some change to another service. Worse, it will be ignored on boot if you use the default parallel booting. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) iD8DBQFIYEc4tTMYHG2NR9URAiC6AKCPjcfn2s6brPVSUAP4jhbeeXor+wCfZQ6S xF9wXkmPVYMBArVPU1y1WJs= =VDet -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Mon, Jun 30, 2008 at 8:20 PM, Brian K. White
<snip>
The script above is of course a minimal example/sample.
It should work just as it is if the license daemon is a simple program that just needs to be run without any other special steps or actions. Some daemons require lockfiles or pid files or config files or environment variables or named pipes (fifos) or device nodes or other daemon processes or special user accounts etc etc etc to be set up in order to run. All such actions will be in the S99 script they provided and you would have to replicate them in this script in the start) and stop) sections, most likely just before the startproc and killproc lines.
Nice post, thanx ... a keeper, for sure. You should consider putting that on the wiki? Peter -- "There is a grandeur in this view of life, a life in which endless forms most beautiful and most wonderful have been, and are being, evolved." Charles Darwin The Origin of Species http://xkcd.com/167/ www.the-brights.net -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Thanks a lot for all the comments. However, I hope a direct usable suggestion for testing can come as a result of additional background and actual content listing as follows: First additonal background info: The CAD application is Medusa4 from Cad Schroer Gmb (CSG), Germany. I've run the previous Medusa Classic on Solaris several years. Medusa4 is currently supported on Windows, Solaris and Linux. But unhappily only on RHEL3 and 4 Linux so far (be sure I've tried to get it supported also on openSUSE/SLE). By the way, I've installed it and will give it a try preferably on my openSUSE 11 mobil workstation (hp8710w) now. The "floating tcp/ip based" keyfile license server for the commersial Medusa4 (there is also a free personal demo/Medusa4 available on Windows and Linux with a local keyfile) is based on the wellknown FLEX LM system, though called csglmd in this case. It has functions (lmutil +arguments) for manual reread of keyfile, stop, status and more controls. I've installed the license server on our SLES10/OES2 office server, and can reach the license over OpenVPN and Internet connection from Medusa4 running on my mobile workstation. Next the content listing: The S99csg startup script available from the license server installation was suggested to be saved on /etc/rc2.d (probably on RHEL or Solaris). Therefore my question about /etc/init.d/rc2.d on Suse. Two scripts. # cat S99csg #Startup CSG Security Server /bin/sh /csglicense/csglmd.rc # cat csglmd.rc #!/bin/sh if [ -f /csglicense/lmgrd -a -f /csglicense/csglmd.lic ]; then if [ -f /csglicense/csglmd.log ]; then mv -f /csglicense/csglmd.log /csglicense/csglmd_old.log fi /csglicense/lmgrd -t 15 -c /csglicense/csglmd.lic > /csglicense/csglmd.log & fi So far I can start the license server manually using the command from the S99csg startup script # /csglicense/csglmd.rc Beside I've used the lmutil with several arguments for controlling the server. Brian K. White wrote:
# The default runlevel is defined here id:3:initdefault:
What number is in your file where mine has :3: ? Probably 3 or 5.
In my SLES10 case the number is 5, yes Carlos E. R wrote:
Where should this S99 script be located on SLES10 and possibly how to activate it?
Nowhere. Impossible.
I've tried to save the S99 script in /etc/init.d/rc2.d but this didn't restart the license server. Possibly how to activate it in addition?
That method is not conformant to the methods used on suse to start/stop services automatically and will not work. Ask your vendor to provide a script compatible with suse.
As I wrote above, CSG won't provide a script for Suse as far as they don't support it. Therefore I have to do the best out of the available S99 sript (for RHEL?) above. Thanks, Terje J: Hanssen -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Tuesday 2008-06-24 at 16:50 +0200, Terje J. Hanssen wrote: ...
Two scripts.
# cat S99csg #Startup CSG Security Server /bin/sh /csglicense/csglmd.rc
So far I can start the license server manually using the command from the S99csg startup script
...
Carlos E. R wrote:
Where should this S99 script be located on SLES10 and possibly how to activate it?
Nowhere. Impossible.
I've tried to save the S99 script in /etc/init.d/rc2.d but this didn't restart the license server. Possibly how to activate it in addition?
That method is not conformant to the methods used on suse to start/stop services automatically and will not work. Ask your vendor to provide a script compatible with suse.
As I wrote above, CSG won't provide a script for Suse as far as they don't support it. Therefore I have to do the best out of the available S99 sript (for RHEL?) above.
You case is very simple: take the "/etc/init.d/skeleton.compat", copy it to /etc/init.d/csg, and modify it thus (I only write the modified lines - not tested - mutandis mutandi): ... ### BEGIN INIT INFO # Provides: CSGSecServer # Required-Start: $ALL # Should-Start: # Required-Stop: $ALL # Should-Stop: # Default-Start: 3 4 5 # Default-Stop: 0 1 2 6 # Short-Description: Startup CSG Security Server ... FOO_BIN= .. delete paragraph FOO_CONFIG=/csglicense/csglmd.rc # Shame on them for choosing that path! case "$1" in start) echo -n "Starting FOO " /bin/sh $FOO_CONFIG # Remember status and be verbose rc_status -v ;; stop) rc_status -v ;; status) rc_status -v ;; # or do something appropriate And that's that. Install by "chkconfig csg on". Shame on them! More info: search this thread: Date: Tue, 10 Jun 2008 06:07:03 -0400 Subject: [opensuse] services does not start automatically after a reboot on SLES 10 - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) iD8DBQFIYT4VtTMYHG2NR9URAnUGAJ9rmt920f4Lyn/rl/CHgyZPtBvFVwCZAYxq dvGTOwGdApf2dgjpM4Os8cQ= =IIRr -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (5)
-
Brian K. White
-
Carlos E. R.
-
Peter Van Lone
-
Philipp Thomas
-
Terje J. Hanssen