How to run a startup script using systemd



How to run a startup script using systemd

How to run a startup script using systemd

Today’s tip is how to run a startup script using systemd. If everything you need is to run a simple startup script when you boot into Linux, there’s no need to become an expert in systemd. Below are the files I used on this video.

/usr/local/sbin/my-startup.sh:
#!/bin/sh

hdparm -Y /dev/sdb

/etc/systemd/system/my-startup.service:
[Unit]
Description=Startup

[Service]
ExecStart=/usr/local/sbin/my-startup.sh

[Install]
WantedBy=multi-user.target

Comments are closed.