Quantcast
Channel: Debian User Forums
Viewing all articles
Browse latest Browse all 2849

Beginners Questions • [Software] How do I run a script at startup?

$
0
0
I have a script in /usr/local/sbin that I would like to run everytime the PC (and Debian) starts.

I have ...

-rw-r--r-- 1 root root 185 Feb 2 19:23 startup.service

in /etc/systemd/system]

Contents of that file are:

===

# startup.service

[Unit]
Description=Run the run-at-startup.sh script systemd service.

[Service]
Type=simple
ExecStart=/bin/sh /usr/local/sbin/run-at-startup.sh

[Install]
WantedBy=multi-user.target


===

# ls -al /usr/local/sbin/run-at-startup.sh
-rwxr-xr-x 1 root root 56 Feb 2 19:33 /usr/local/sbin/run-at-startup.sh


And the contents of that startup script are ...

===
# less /usr/local/sbin/run-at-startup.sh
#!/bin/sh


echo Starting ....

logger Starting ...

===



What am I doing incorrectly?

thx.

Statistics: Posted by diningroom — 2025-02-03 02:46



Viewing all articles
Browse latest Browse all 2849

Trending Articles