Script after full system is up
Hi all I am running SLES 11 SP3 and I want a script to run after the full system is up. How can I achieve this? I am looking and browsing but I haven't had any luck with rc.local. Thank you! Sent from my iPhone -- For LINUX-390 subscribe / signoff / archive access instructions, send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 -- For more information on Linux on System z, visit http://wiki.linuxvm.org/
Re: Script after full system is up
Cron, in addition to running things at specific times, will allow the time specification to be ³@reboot /path/to/script². This will run late in the boot sequence, after everything is up and running. In your script, if you depend on a specific service being available, check for it before getting into the meat of your application. -- Robert P. Nix | Sr IT Systems Engineer | Data Center Infrastructure Services Mayo Clinic | 200 First Street SW | Rochester, MN 55905 507-284-0844 | nix.rob...@mayo.edu "quando omni flunks moritati" On 2/8/16, 2:08 PM, "Linux on 390 Port on behalf of Michael Weiner" wrote: >Hi all > >I am running SLES 11 SP3 and I want a script to run after the full system >is up. How can I achieve this? I am looking and browsing but I haven't >had any luck with rc.local. > >Thank you! > >Sent from my iPhone >-- >For LINUX-390 subscribe / signoff / archive access instructions, >send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or >visit >http://www.marist.edu/htbin/wlvindex?LINUX-390 >-- >For more information on Linux on System z, visit >http://wiki.linuxvm.org/ -- For LINUX-390 subscribe / signoff / archive access instructions, send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 -- For more information on Linux on System z, visit http://wiki.linuxvm.org/
Re: Script after full system is up
You can add an entry in a crontab where the line is prefixed with '@reboot'. Check out the man page for the crontab file. -Original Message- From: Linux on 390 Port [mailto:LINUX-390@VM.MARIST.EDU] On Behalf Of Michael Weiner Sent: Monday, February 08, 2016 2:09 PM To: LINUX-390@VM.MARIST.EDU Subject: Script after full system is up Hi all I am running SLES 11 SP3 and I want a script to run after the full system is up. How can I achieve this? I am looking and browsing but I haven't had any luck with rc.local. Thank you! Sent from my iPhone -- For LINUX-390 subscribe / signoff / archive access instructions, send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 -- For more information on Linux on System z, visit http://wiki.linuxvm.org/ © 2016 Ensono, LP. All rights reserved. Ensono is a trademark of Ensono, LP. The information contained in this communication is confidential, is intended only for the use of the recipient named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please resend this communication to the sender and delete the original message or any copy of it from your computer system.
Re: Script after full system is up
Thanks. That's actually what I did for testing but for some reason I got a mail in root saying two of my commands were wrong. The script works fine. Not sure why Sent from my iPhone > On Feb 8, 2016, at 3:24 PM, Harley Linker wrote: > > You can add an entry in a crontab where the line is prefixed with '@reboot'. > Check out the man page for the crontab file. > > > > -Original Message- > From: Linux on 390 Port [mailto:LINUX-390@VM.MARIST.EDU] On Behalf Of Michael > Weiner > Sent: Monday, February 08, 2016 2:09 PM > To: LINUX-390@VM.MARIST.EDU > Subject: Script after full system is up > > Hi all > > I am running SLES 11 SP3 and I want a script to run after the full system is > up. How can I achieve this? I am looking and browsing but I haven't had any > luck with rc.local. > > Thank you! > > Sent from my iPhone > -- > For LINUX-390 subscribe / signoff / archive access instructions, send email > to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit > http://www.marist.edu/htbin/wlvindex?LINUX-390 > -- > For more information on Linux on System z, visit http://wiki.linuxvm.org/ > © 2016 Ensono, LP. All rights reserved. Ensono is a trademark of Ensono, LP. > The information contained in this communication is confidential, is intended > only for the use of the recipient named above, and may be legally privileged. > If the reader of this message is not the intended recipient, you are hereby > notified that any dissemination, distribution or copying of this > communication is strictly prohibited. If you have received this communication > in error, please resend this communication to the sender and delete the > original message or any copy of it from your computer system. -- For LINUX-390 subscribe / signoff / archive access instructions, send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 -- For more information on Linux on System z, visit http://wiki.linuxvm.org/
Re: Script after full system is up
It could be the PATH var. Try to env > /tmp/something on the cron script and running it by hand. Try to use absolute paths too. On Feb 8, 2016 20:21, "Michael Weiner" wrote: > Thanks. That's actually what I did for testing but for some reason I got a > mail in root saying two of my commands were wrong. > > The script works fine. Not sure why > > Sent from my iPhone > > > On Feb 8, 2016, at 3:24 PM, Harley Linker > wrote: > > > > You can add an entry in a crontab where the line is prefixed with > '@reboot'. Check out the man page for the crontab file. > > > > > > > > -Original Message- > > From: Linux on 390 Port [mailto:LINUX-390@VM.MARIST.EDU] On Behalf Of > Michael Weiner > > Sent: Monday, February 08, 2016 2:09 PM > > To: LINUX-390@VM.MARIST.EDU > > Subject: Script after full system is up > > > > Hi all > > > > I am running SLES 11 SP3 and I want a script to run after the full > system is up. How can I achieve this? I am looking and browsing but I > haven't had any luck with rc.local. > > > > Thank you! > > > > Sent from my iPhone > > -- > > For LINUX-390 subscribe / signoff / archive access instructions, send > email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit > > http://www.marist.edu/htbin/wlvindex?LINUX-390 > > -- > > For more information on Linux on System z, visit > http://wiki.linuxvm.org/ > > © 2016 Ensono, LP. All rights reserved. Ensono is a trademark of Ensono, > LP. The information contained in this communication is confidential, is > intended only for the use of the recipient named above, and may be legally > privileged. If the reader of this message is not the intended recipient, > you are hereby notified that any dissemination, distribution or copying of > this communication is strictly prohibited. If you have received this > communication in error, please resend this communication to the sender and > delete the original message or any copy of it from your computer system. > > -- > For LINUX-390 subscribe / signoff / archive access instructions, > send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or > visit > http://www.marist.edu/htbin/wlvindex?LINUX-390 > -- > For more information on Linux on System z, visit > http://wiki.linuxvm.org/ > -- For LINUX-390 subscribe / signoff / archive access instructions, send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 -- For more information on Linux on System z, visit http://wiki.linuxvm.org/
Re: Script after full system is up
>>> On 2/8/2016 at 03:08 PM, Michael Weiner wrote: > I am running SLES 11 SP3 and I want a script to run after the full system is > up. How can I achieve this? I am looking and browsing but I haven't had any > luck with rc.local. Getting this to work as desired is fairly difficult using SysV init. The best way, which still might not be satisfactory depending on exactly what you are trying to do, is to create your own script in /etc/init.d/, using /etc/init.d/skeleton as the basis. You'll want to use $ALL for the Required-Start line: ### BEGIN INIT INFO # Provides: FOO # Required-Start:$ALL Once you're happy with the script, execute the insserv command: insserv scriptname Look in the directory for the default run-level, say run-level 3: ls rc3.d Hopefully, you'll see a symbolic to your script at or somewhere near the end of the S* entries. Mark Post -- For LINUX-390 subscribe / signoff / archive access instructions, send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 -- For more information on Linux on System z, visit http://wiki.linuxvm.org/
Re: Script after full system is up
Thanks all. Will give it a try. Sent from my iPhone On Feb 9, 2016, at 6:06 PM, Mark Post wrote: On 2/8/2016 at 03:08 PM, Michael Weiner wrote: > >> I am running SLES 11 SP3 and I want a script to run after the full system is >> up. How can I achieve this? I am looking and browsing but I haven't had any >> luck with rc.local. > > Getting this to work as desired is fairly difficult using SysV init. The > best way, which still might not be satisfactory depending on exactly what you > are trying to do, is to create your own script in /etc/init.d/, using > /etc/init.d/skeleton as the basis. You'll want to use $ALL for the > Required-Start line: > ### BEGIN INIT INFO > # Provides: FOO > # Required-Start:$ALL > > Once you're happy with the script, execute the insserv command: > insserv scriptname > > Look in the directory for the default run-level, say run-level 3: > ls rc3.d > > Hopefully, you'll see a symbolic to your script at or somewhere near the end > of the S* entries. > > > Mark Post > > -- > For LINUX-390 subscribe / signoff / archive access instructions, > send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit > http://www.marist.edu/htbin/wlvindex?LINUX-390 > -- > For more information on Linux on System z, visit > http://wiki.linuxvm.org/ -- For LINUX-390 subscribe / signoff / archive access instructions, send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 -- For more information on Linux on System z, visit http://wiki.linuxvm.org/
Re: Script after full system is up
Mark Would you say rc.local does not work? Sent from my iPhone On Feb 9, 2016, at 6:06 PM, Mark Post wrote: On 2/8/2016 at 03:08 PM, Michael Weiner wrote: > >> I am running SLES 11 SP3 and I want a script to run after the full system is >> up. How can I achieve this? I am looking and browsing but I haven't had any >> luck with rc.local. > > Getting this to work as desired is fairly difficult using SysV init. The > best way, which still might not be satisfactory depending on exactly what you > are trying to do, is to create your own script in /etc/init.d/, using > /etc/init.d/skeleton as the basis. You'll want to use $ALL for the > Required-Start line: > ### BEGIN INIT INFO > # Provides: FOO > # Required-Start:$ALL > > Once you're happy with the script, execute the insserv command: > insserv scriptname > > Look in the directory for the default run-level, say run-level 3: > ls rc3.d > > Hopefully, you'll see a symbolic to your script at or somewhere near the end > of the S* entries. > > > Mark Post > > -- > For LINUX-390 subscribe / signoff / archive access instructions, > send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit > http://www.marist.edu/htbin/wlvindex?LINUX-390 > -- > For more information on Linux on System z, visit > http://wiki.linuxvm.org/ -- For LINUX-390 subscribe / signoff / archive access instructions, send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 -- For more information on Linux on System z, visit http://wiki.linuxvm.org/
Re: Script after full system is up
>>> On 2/9/2016 at 06:17 PM, Michael Weiner wrote: > Would you say rc.local does not work? I wouldn't say it won't work, but as I indicated, getting this sort of thing to work well with SysV init isn't easy. Mark Post -- For LINUX-390 subscribe / signoff / archive access instructions, send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 -- For more information on Linux on System z, visit http://wiki.linuxvm.org/
Re: Script after full system is up
Hello, I would indeed do as suggested by Mark creating an init.d script. You can find some more info about creating those scripts here: (and an example) http://unix.stackexchange.com/questions/43230/how-to-run-my-script-after-suse-finished-booting-up You can also try crontab (not really recommended) by using @reboot in crontab. (Not sure if this will work on SUSE to be honest. Check the man page) BR/ Robbert de Schepper _ Robbert de Schepper Infrastructure Operation Professional - zLinux IT Services Volvo Group Headquarters Corporate Process & IT Department 94420 Smalleheerweg 29, 9041, Gent - Belgium Telephone: +32 (0)9 239 76 93 Mobile: +32 (0)4 918 60 392 Email: robbert.de.schep...@volvo.com -Original Message- From: Linux on 390 Port [mailto:LINUX-390@VM.MARIST.EDU] On Behalf Of Mark Post Sent: woensdag 10 februari 2016 12:23 To: LINUX-390@VM.MARIST.EDU Subject: Re: Script after full system is up >>> On 2/9/2016 at 06:17 PM, Michael Weiner wrote: > Would you say rc.local does not work? I wouldn't say it won't work, but as I indicated, getting this sort of thing to work well with SysV init isn't easy. Mark Post -- For LINUX-390 subscribe / signoff / archive access instructions, send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 -- For more information on Linux on System z, visit http://wiki.linuxvm.org/ -- For LINUX-390 subscribe / signoff / archive access instructions, send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 -- For more information on Linux on System z, visit http://wiki.linuxvm.org/
Re: Script after full system is up
The other advantage of the crontab entry though, is that non-privileged users can set their own up without requiring root access. This puts the ongoing maintenance of the script in the application owner¹s hands, rather than requiring intervention of someone with root access. -- Robert P. Nix | Sr IT Systems Engineer | Data Center Infrastructure Services Mayo Clinic | 200 First Street SW | Rochester, MN 55905 507-284-0844 | nix.rob...@mayo.edu "quando omni flunks moritati" On 2/10/16, 1:08 AM, "Linux on 390 Port on behalf of de Schepper Robbert" wrote: >Hello, > > >I would indeed do as suggested by Mark creating an init.d script. >You can find some more info about creating those scripts here: (and an >example) >http://unix.stackexchange.com/questions/43230/how-to-run-my-script-after-s >use-finished-booting-up > >You can also try crontab (not really recommended) by using @reboot in >crontab. >(Not sure if this will work on SUSE to be honest. Check the man page) > >BR/ >Robbert de Schepper > >_ >Robbert de Schepper >Infrastructure Operation Professional - zLinux >IT Services > >Volvo Group Headquarters >Corporate Process & IT >Department 94420 >Smalleheerweg 29, 9041, Gent - Belgium >Telephone: +32 (0)9 239 76 93 >Mobile: +32 (0)4 918 60 392 >Email: robbert.de.schep...@volvo.com > > >-Original Message- >From: Linux on 390 Port [mailto:LINUX-390@VM.MARIST.EDU] On Behalf Of >Mark Post >Sent: woensdag 10 februari 2016 12:23 >To: LINUX-390@VM.MARIST.EDU >Subject: Re: Script after full system is up > >>>> On 2/9/2016 at 06:17 PM, Michael Weiner >>>>wrote: >> Would you say rc.local does not work? > >I wouldn't say it won't work, but as I indicated, getting this sort of >thing to work well with SysV init isn't easy. > > >Mark Post > >-- >For LINUX-390 subscribe / signoff / archive access instructions, >send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or >visit >http://www.marist.edu/htbin/wlvindex?LINUX-390 >-- >For more information on Linux on System z, visit >http://wiki.linuxvm.org/ > >-- >For LINUX-390 subscribe / signoff / archive access instructions, >send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or >visit >http://www.marist.edu/htbin/wlvindex?LINUX-390 >-- >For more information on Linux on System z, visit >http://wiki.linuxvm.org/ -- For LINUX-390 subscribe / signoff / archive access instructions, send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 -- For more information on Linux on System z, visit http://wiki.linuxvm.org/
Re: Script after full system is up
Thanks All! Sent from my iPhone > On Feb 10, 2016, at 2:08 AM, de Schepper Robbert > wrote: > > Hello, > > > I would indeed do as suggested by Mark creating an init.d script. > You can find some more info about creating those scripts here: (and an > example) > http://unix.stackexchange.com/questions/43230/how-to-run-my-script-after-suse-finished-booting-up > > > You can also try crontab (not really recommended) by using @reboot in > crontab. > (Not sure if this will work on SUSE to be honest. Check the man page) > > BR/ > Robbert de Schepper > > _ > Robbert de Schepper > Infrastructure Operation Professional - zLinux > IT Services > > Volvo Group Headquarters > Corporate Process & IT > Department 94420 > Smalleheerweg 29, 9041, Gent - Belgium > Telephone: +32 (0)9 239 76 93 > Mobile: +32 (0)4 918 60 392 > Email: robbert.de.schep...@volvo.com > > > -Original Message- > From: Linux on 390 Port [mailto:LINUX-390@VM.MARIST.EDU] On Behalf Of Mark > Post > Sent: woensdag 10 februari 2016 12:23 > To: LINUX-390@VM.MARIST.EDU > Subject: Re: Script after full system is up > >>>> On 2/9/2016 at 06:17 PM, Michael Weiner wrote: >> Would you say rc.local does not work? > > I wouldn't say it won't work, but as I indicated, getting this sort of thing > to work well with SysV init isn't easy. > > > Mark Post > > -- > For LINUX-390 subscribe / signoff / archive access instructions, > send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit > http://www.marist.edu/htbin/wlvindex?LINUX-390 > -- > For more information on Linux on System z, visit > http://wiki.linuxvm.org/ > > -- > For LINUX-390 subscribe / signoff / archive access instructions, > send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit > http://www.marist.edu/htbin/wlvindex?LINUX-390 > -- > For more information on Linux on System z, visit > http://wiki.linuxvm.org/ -- For LINUX-390 subscribe / signoff / archive access instructions, send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 -- For more information on Linux on System z, visit http://wiki.linuxvm.org/