Re: how to start bash script application on boot in Opensuse Leap 15

Originally Posted by
rsebok
we have a utility we want to run on startup. in terminal we run it with "sudo ./xxxxx" where xxxx is the application.
We have tried Gnome Utility Tweaker but that doesn't give us the ability to start a bash script.
How do we do this? Thanks!!!!
Hi and Welcome to the Forum 
You can create a simple systemd service file pointing at your script in
/etc/systemd/system called say script001.service containing;
Code:
# /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;
Code:
systemctl start script001.service
systemctl status script001.service
{if all ok}
systemctl enable script001.service
Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below... Thanks!