I have a test enviorment, and need 20 VM’s too run a script after completing Boot UP. I have 2 options…
Auto Logon and run from bin directory (I think thats correct)
or
Run the script at the end of the boot. In RedHat, theres the rc.local which runs at the end of the boot. What does SuSE provide for a user to kick up a simple script. I really dont want the complexity of INIT. Is there away to configure the cron to run a job right after boot up?
What does it do? Does it do something system-wide (regardless of who
logs into the box, or who doesn’t login) or something just for your
user? If system-wide init scripts are probably the way to go but if
it’s something just for you then you can create a startup script for
yourself… Control Center: Sessions: create a new entry in things to be
started on login.
Good luck.
Johnfm3 wrote:
> I have a test enviorment, and need 20 VM’s too run a script after
> completing Boot UP. I have 2 options…
> Auto Logon and run from bin directory (I think thats correct)
>
> or
>
> Run the script at the end of the boot. In RedHat, theres the rc.local
> which runs at the end of the boot. What does SuSE provide for a user to
> kick up a simple script. I really dont want the complexity of INIT. Is
> there away to configure the cron to run a job right after boot up?
>
> Thanks,
> John
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
Sorry not to explain. This something system wide. Upon boot, this script mounts a NFS share, reads a file for the top line which is a server name, removes that entry in the file, closes the file, changes the host name to the server (VM) thats running the script, and updates an other file (thats located on the NFS share) with the NewHostName, IP, & MAC address.
Is this a one-time thing? If this is a one-time thing you may want to
do it manually, but then again creating an init script is really, really
easy. Copy /etc/init.d/skeleton to /etc/init.d/script_name_here and put
your command in there under the ‘start’ section. When done create a
softlink/symlink in /etc/init.d/rcX.d where ‘X’ is your default runlevel
(for a server I would assume and have ‘3’, but it’s up to you). Name
the symlink S99script_name_here so it is the last thing to start in that
runlevel. Finally have your init script (or the one called by it)
remove that symlink. If it runs on every startup then just don’t delete
the symlink.
Good luck.
Johnfm3 wrote:
> Sorry not to explain. This something system wide. Upon boot, this
> script mounts a NFS share, reads a file for the top line which is a
> server name, removes that entry in the file, closes the file, changes
> the host name to the server (VM) thats running the script, and updates
> an other file (thats located on the NFS share) with the NewHostName, IP,
> & MAC address.
>
> Thanks,
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
The problem is that a manually created symlink is liable to be removed by the SuSEconfig system next time a reconfigure happens, usually after a package update. The system will then create a symlink whose sequence number is derived from the dependencies, and it will likely not be 99. To ensure that it gets sequenced last you should use the pseudo-dependency $ALL in the Required-Start: at the top of the file, and the install the symlinks in all applicable runlevels using
Yes… very true. If you need to run this more than just on first boot
set it up as a proper service as ken yap explained.
Good luck.
ken yap wrote:
> The problem is that a manually created symlink is liable to be removed
> by the SuSEconfig system next time a reconfigure happens, usually after
> a package update. The system will then create a symlink whose sequence
> number is derived from the dependencies, and it will likely not be 99.
> To ensure that it gets sequenced last you should use the
> pseudo-dependency $ALL in the Required-Start: at the top of the file,
> and the install the symlinks in all applicable runlevels using
>
>
> Code:
> --------------------
> chkconfig --set myservice on
> --------------------
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org