Executing Scripts: Need Help

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 SIGNED MESSAGE-----
Hash: SHA1

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

iQIcBAEBAgAGBQJJpeDvAAoJEFl00+q2r0YpXLwQAIzAjCerXQdAo7hf40WtymvL
cNE1tUyekUh7GiXGpsmb73ifsuz5w3NXRX2OsVE7EGhw7AVBL8+AZt1nt8Emiyz/
3IMki8Y+GuIFdUO2WBGZDnJPTWchbZNYb9Adxe8Z7/eKwqqYvBKU6e+abSd9hlni
ZIVKEOaC0hGShxhhcC8fxJgyBczZraSgGPh1ra7quLEwZrDaqCQrO9xLnU6eFSm9
fWmzwE6P3iENjHpwJU5bUk2LfM5pAaP+pA3yDQiWSTXBKPkSDh8/6KIJQ2T8OKXQ
pM8tDwKyfXBuZRwBbWB6qWIqzWb8VzNeLxOmXeVihJd5qIqvEaoD9ZbBxX8HHqXM
etb1wgAWlVQZqZds7NQXPD9y/T0yS+xzxADc8jDSwiYO1hPlSOcBN5JbS/iN3Cfx
2P9QlLUdyJ9M5QVbDMFPDKSKcjtT7Ou4++6SbOPhIIb493ZsHIanqU9tQAvP9rER
/hLKy4MgeTxm44v88u42RbMdWWaNMzGoYmXcQ2tPdteecFVQvmtWNB6hYbIQtWMd
BcyiU+6wurVjfx+YiSMFK++701DKd1clZNEZ46kX39qlNA4sH/2tA4MNLO0X/e+H
Epx83KDfVd+AF9kwS6AaTa/t7YAm5h8EE4cmrvwM4wRoK53+bz576rfXtqZQf6zR
nzmLgJSIdx/zhZN/cdR8
=fqD1
-----END PGP SIGNATURE-----

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 SIGNED MESSAGE-----
Hash: SHA1

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

iQIcBAEBAgAGBQJJpeptAAoJEFl00+q2r0YpmL0P/2YI/W6GmEtQZvgXpBU/TYS7
Zm5GOXS7C2c9VmrmpWWe9rej2sKAgu+FFJW7PVx8QyOCYch0bOOFTg0sHiWUUoRO
V+HosjkBWFuMJ3geYhoLruWwllWyfSMgrzlTXo6Qw1UyU19hvVQnRElBOYziZ+OA
7A2JWF0dbPn7l9S5SomBQOxcn83y+nP8Al3hFPIXNyvPR4hlS9VXjNLoJqDPcg4K
1oUIjsWAsGxzuTOi7uC4vdc/Kq+XdnIE0SPENdR/HjLVBjm5CN6V9dlf18GezRPk
J30f538J6AUa7C3q+JDNWl6cky3ydS51ox5TRxevbkvlSk7EGDGpCTMiOS9/0rSU
dapxpInpPaio66Gb4x4Ff6uu+O351PzCYuEB0TohykYTdw0wQYDWgEAUe+EOT1fj
tlQdQj8LBJUzNzGgr1GerizdZGdM0Z9oAFmDxMJ/o4yHNZGrRYnisNa9aVPH/L0m
j7fNquxxfYRhsPehVrAhBIUcZsS0/dPK6jqDGKIfeIzmhr8KFSBuDO+NjACBcxRQ
phEpXGe6zetiLlFw6s2UGkaZcSDdzUX1r/tRZZZ9cCxUB6RdvlWAnQukRoqPv4+n
U2C0pBPzC1uVtO+WmSWJdpV1fjhgDiy3axjYOU7HOgHcDzbw2Bk/lMGOngQYnHnJ
iIAov5vV0YOraHWSN/iz
=dJxD
-----END PGP SIGNATURE-----

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

chkconfig --set myservice on

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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

iQIcBAEBAgAGBQJJpf6sAAoJEFl00+q2r0YpaawP/1T8s/kkg88/riCN1JTD9RRJ
/R3hHxnEQUMVMA5oO8ZX1lAYROMtlQ4S3h1C2xv0wnjDxWKcjAe9JV+3Lc5xDLjB
+7pDwJroY25Sky3he1ZgjGc30ikKcHWIi5S5MruepjYkYYucRGe/dF+Fe0VQ5Mfq
J08cTNewtE5DYorJee6vxONm4MxmUeosDjMQdRXrN+579hZUW12UOT0sMj2LlQox
J1jm4Lx73lEK+UEITb4Z48wk1GsJg05/yNJcFSJN2CC8XQfMjpTjLguzPb0+Sbrp
cPLaTZ2K8yoI6umyaGzD1BiEsRnwGjLI95rV3ew8HA63oSNsTGKcfl2VK/xa7wrS
KB8LhRehkTMPP8yxET8jhxJwjIC1KSSZQ8+QZW9DeA/GjMdmPTfaeR9Igw1ybjFH
PO5y9Ljyr32Kidsdy1fLgaOUEBhy7Pbjo1838L1QGhYQS2wXf3gBY67gHWtUV9FK
Gce5HudeZCGrEI+V7EiS4pLc80q7YC6qnZWGSeKoRMPliokiGcJZYG6NL2OKqspO
n3yWifymYWXA8xEdsr4ENDtRWW3sALDZvelZ2SjEXBdU/0C+1QWmvON7h4yW91n4
eW4RB038b3cM2cuszwGwd1MIp26Us7MDlhHSyKOIrDNJs0C2mWi1qiFh2YJBF8J3
IHO6Vj8jOZkqSMXhHf6M
=4fjq
-----END PGP SIGNATURE-----