Use hyphens rather than underscores for service name
It's the most common convention, here's how it is on my system:
$ find /usr/lib/systemd/system -name '*_*' | wc -l
12
$ find /usr/lib/systemd/system -name '*-*' | wc -l
278
Arnaud Rebillout
2 years ago
0 | [Unit] | |
1 | Description=Regenerate SSH host keys | |
2 | ConditionPathExists=/usr/sbin/sshd | |
3 | Before=ssh.service | |
4 | ConditionPathExistsGlob=!/etc/ssh/ssh_host_*_key | |
5 | ||
6 | [Service] | |
7 | Type=oneshot | |
8 | ExecStart=/usr/bin/ssh-keygen -A | |
9 | ||
10 | [Install] | |
11 | RequiredBy=multi-user.target |