SLES 15 - How to run script at startup

Hello,

I am try with Suse Linux Enterprise 15 for upgrade my server, but I don’t find where I run my script of inicialization, befor in SLES 12 I put in /etc/init.d/after.local but this file don’t exist in this version.

Thanks in advanced.

[QUOTE=phrix;54810]Hello,

I am try with Suse Linux Enterprise 15 for upgrade my server, but I don’t find where I run my script of inicialization, befor in SLES 12 I put in /etc/init.d/after.local but this file don’t exist in this version.

Thanks in advanced.[/QUOTE]
Hi
You can create a simple systemd service file pointing at your script in /etc/systemd/system called say script001.service containing;

# /etc/systemd/system/script001.service
#

[Unit]
Description=Run my boot script

[Service]
Type=oneshot
ExecStart=/bin/sh -c "/path/to/script/scriptname"

[Install]
WantedBy=multi-user.target

Once that’s saved, you can run, check and enable;

systemctl start script001.service
systemctl status script001.service
{if all ok}
systemctl enable script001.service

Perfect Malcolm!

Thanks.