How to set up a non-Docker node using systemd services with the official native storagenode binary

Do you have an alias storagenode by the way?

root@storj:/etc/systemd/system# ls -l
total 32
lrwxrwxrwx 1 root root   33 May  4 18:19 ctrl-alt-del.target -> /lib/systemd/system/reboot.target
lrwxrwxrwx 1 root root   45 Oct 10  2023 dbus-org.freedesktop.timesync1.service -> /lib/systemd/system/systemd-timesyncd.service
drwxr-xr-x 2 root root 4096 May  4 18:19 getty.target.wants
drwxr-xr-x 2 root root 4096 May  4 18:42 multi-user.target.wants
drwxr-xr-x 2 root root 4096 May  4 18:19 network-online.target.wants
drwxr-xr-x 2 root root 4096 May  4 18:19 sockets.target.wants
lrwxrwxrwx 1 root root   31 Oct 10  2023 sshd.service -> /lib/systemd/system/ssh.service
-rwxrwxrwx 1 root root 1075 May  4 18:38 storagenode-updater.service
-rwxrwxrwx 1 root root 1063 May 12 11:53 storagenode.service
lrwxrwxrwx 1 root root    9 Oct 10  2023 sys-kernel-debug.mount -> /dev/null
drwxr-xr-x 2 root root 4096 May  4 18:19 sysinit.target.wants
drwxr-xr-x 2 root root 4096 Oct 10  2023 timers.target.wants
root@storj:/etc/systemd/system# sudo systemctl enable storagenode
Failed to enable unit: Cannot alias storagenode.service as storagenode.

It still doesn’t work

1 Like

Where should I look?

Running the command?

$ alias

It doesn’t give anything back.

This is weird, do it so with a sudo also?

root@storj:/# alias
root@storj:/#
root@storj:/# sudo alias
sudo: alias: command not found
1 Like

can you please check the unit file?

1 Like
root@storj:/etc/systemd/system# systemd-analyze verify storagenode.service
Configuration file /etc/systemd/system/storagenode.service is marked executable. Please remove executable permission bits. Proceeding anyway.
Configuration file /etc/systemd/system/storagenode.service is marked world-writable. Please remove world writability permission bits. Proceeding anyway.

do I have to do something?

root@storj:/etc/systemd/system# ls -l
total 32
lrwxrwxrwx 1 root root   33 May  4 18:19 ctrl-alt-del.target -> /lib/systemd/system/reboot.target
lrwxrwxrwx 1 root root   45 Oct 10  2023 dbus-org.freedesktop.timesync1.service -> /lib/systemd/system/systemd-timesyncd.service
drwxr-xr-x 2 root root 4096 May  4 18:19 getty.target.wants
drwxr-xr-x 2 root root 4096 May  4 18:42 multi-user.target.wants
drwxr-xr-x 2 root root 4096 May  4 18:19 network-online.target.wants
drwxr-xr-x 2 root root 4096 May  4 18:19 sockets.target.wants
lrwxrwxrwx 1 root root   31 Oct 10  2023 sshd.service -> /lib/systemd/system/ssh.service
-rwxrwxrwx 1 root root 1075 May  4 18:38 storagenode-updater.service
-rwxrwxrwx 1 root root 1063 May 12 11:53 storagenode.service
lrwxrwxrwx 1 root root    9 Oct 10  2023 sys-kernel-debug.mount -> /dev/null
drwxr-xr-x 2 root root 4096 May  4 18:19 sysinit.target.wants
drwxr-xr-x 2 root root 4096 Oct 10  2023 timers.target.wants
root@storj:/etc/systemd/system#
root@storj:/etc/systemd/system# ls -l ./getty.target.wants/
total 0
lrwxrwxrwx 1 root root 44 May  4 18:19 container-getty@1.service -> /lib/systemd/system/container-getty@.service
lrwxrwxrwx 1 root root 44 May  4 18:19 container-getty@2.service -> /lib/systemd/system/container-getty@.service
root@storj:/etc/systemd/system#
root@storj:/etc/systemd/system# ls -l ./multi-user.target.wants/
total 0
lrwxrwxrwx 1 root root 32 Oct 10  2023 cron.service -> /lib/systemd/system/cron.service
lrwxrwxrwx 1 root root 40 Oct 10  2023 e2scrub_reap.service -> /lib/systemd/system/e2scrub_reap.service
lrwxrwxrwx 1 root root 38 Oct 10  2023 networking.service -> /lib/systemd/system/networking.service
lrwxrwxrwx 1 root root 43 May  4 18:19 postfix-resolvconf.path -> /lib/systemd/system/postfix-resolvconf.path
lrwxrwxrwx 1 root root 46 May  4 18:19 postfix-resolvconf.service -> /lib/systemd/system/postfix-resolvconf.service
lrwxrwxrwx 1 root root 35 Oct 10  2023 postfix.service -> /lib/systemd/system/postfix.service
lrwxrwxrwx 1 root root 44 May  4 18:19 remote-cryptsetup.target -> /lib/systemd/system/remote-cryptsetup.target
lrwxrwxrwx 1 root root 36 Oct 10  2023 remote-fs.target -> /lib/systemd/system/remote-fs.target
lrwxrwxrwx 1 root root 45 May  4 18:19 remote-veritysetup.target -> /lib/systemd/system/remote-veritysetup.target
lrwxrwxrwx 1 root root 31 Oct 10  2023 ssh.service -> /lib/systemd/system/ssh.service
lrwxrwxrwx 1 root root 39 May  4 18:42 storagenode.service -> /etc/systemd/system/storagenode.service
root@storj:/etc/systemd/system#
root@storj:/etc/systemd/system# ls -l network-online.target.wants/
total 0
lrwxrwxrwx 1 root root 48 May  4 18:19 ifupdown-wait-online.service -> /lib/systemd/system/ifupdown-wait-online.service
lrwxrwxrwx 1 root root 38 Oct 10  2023 networking.service -> /lib/systemd/system/networking.service
root@storj:/etc/systemd/system#
root@storj:/etc/systemd/system# ls -l ./sockets.target.wants/
total 0
lrwxrwxrwx 1 root root 30 May  4 18:19 ssh.socket -> /lib/systemd/system/ssh.socket
lrwxrwxrwx 1 root root 43 May  4 18:19 systemd-networkd.socket -> /lib/systemd/system/systemd-networkd.socket
root@storj:/etc/systemd/system#
root@storj:/etc/systemd/system# ls -l ./sysinit.target.wants/
total 0
lrwxrwxrwx 1 root root 36 May  4 18:19 nftables.service -> /lib/systemd/system/nftables.service
lrwxrwxrwx 1 root root 53 May  4 18:19 systemd-network-generator.service -> /lib/systemd/system/systemd-network-generator.service
lrwxrwxrwx 1 root root 42 Oct 10  2023 systemd-pstore.service -> /lib/systemd/system/systemd-pstore.service
lrwxrwxrwx 1 root root 42 May  4 18:19 systemd-sysext.service -> /lib/systemd/system/systemd-sysext.service
lrwxrwxrwx 1 root root 45 Oct 10  2023 systemd-timesyncd.service -> /lib/systemd/system/systemd-timesyncd.service
root@storj:/etc/systemd/system#
root@storj:/etc/systemd/system# ls -l timers.target.wants/
total 0
lrwxrwxrwx 1 root root 43 Oct 10  2023 apt-daily-upgrade.timer -> /lib/systemd/system/apt-daily-upgrade.timer
lrwxrwxrwx 1 root root 35 Oct 10  2023 apt-daily.timer -> /lib/systemd/system/apt-daily.timer
lrwxrwxrwx 1 root root 40 Oct 10  2023 dpkg-db-backup.timer -> /lib/systemd/system/dpkg-db-backup.timer
lrwxrwxrwx 1 root root 37 Oct 10  2023 e2scrub_all.timer -> /lib/systemd/system/e2scrub_all.timer
lrwxrwxrwx 1 root root 32 Oct 10  2023 fstrim.timer -> /lib/systemd/system/fstrim.timer
lrwxrwxrwx 1 root root 35 Oct 10  2023 logrotate.timer -> /lib/systemd/system/logrotate.timer
lrwxrwxrwx 1 root root 32 Oct 10  2023 man-db.timer -> /lib/systemd/system/man-db.timer
root@storj:/etc/systemd/system#
root@storj:/etc/systemd/system/multi-user.target.wants# ls -l
total 0
lrwxrwxrwx 1 root root 32 Oct 10  2023 cron.service -> /lib/systemd/system/cron.service
lrwxrwxrwx 1 root root 40 Oct 10  2023 e2scrub_reap.service -> /lib/systemd/system/e2scrub_reap.service
lrwxrwxrwx 1 root root 38 Oct 10  2023 networking.service -> /lib/systemd/system/networking.service
lrwxrwxrwx 1 root root 43 May  4 18:19 postfix-resolvconf.path -> /lib/systemd/system/postfix-resolvconf.path
lrwxrwxrwx 1 root root 46 May  4 18:19 postfix-resolvconf.service -> /lib/systemd/system/postfix-resolvconf.service
lrwxrwxrwx 1 root root 35 Oct 10  2023 postfix.service -> /lib/systemd/system/postfix.service
lrwxrwxrwx 1 root root 44 May  4 18:19 remote-cryptsetup.target -> /lib/systemd/system/remote-cryptsetup.target
lrwxrwxrwx 1 root root 36 Oct 10  2023 remote-fs.target -> /lib/systemd/system/remote-fs.target
lrwxrwxrwx 1 root root 45 May  4 18:19 remote-veritysetup.target -> /lib/systemd/system/remote-veritysetup.target
lrwxrwxrwx 1 root root 31 Oct 10  2023 ssh.service -> /lib/systemd/system/ssh.service
lrwxrwxrwx 1 root root 39 May  4 18:42 storagenode.service -> /etc/systemd/system/storagenode.service
root@storj:/etc/systemd/system/multi-user.target.wants#
root@storj:/etc/systemd/system/multi-user.target.wants#
root@storj:/etc/systemd/system/multi-user.target.wants# mv storagenode.service /root/
root@storj:/etc/systemd/system/multi-user.target.wants#
root@storj:/etc/systemd/system/multi-user.target.wants# ls -l
total 0
lrwxrwxrwx 1 root root 32 Oct 10  2023 cron.service -> /lib/systemd/system/cron.service
lrwxrwxrwx 1 root root 40 Oct 10  2023 e2scrub_reap.service -> /lib/systemd/system/e2scrub_reap.service
lrwxrwxrwx 1 root root 38 Oct 10  2023 networking.service -> /lib/systemd/system/networking.service
lrwxrwxrwx 1 root root 43 May  4 18:19 postfix-resolvconf.path -> /lib/systemd/system/postfix-resolvconf.path
lrwxrwxrwx 1 root root 46 May  4 18:19 postfix-resolvconf.service -> /lib/systemd/system/postfix-resolvconf.service
lrwxrwxrwx 1 root root 35 Oct 10  2023 postfix.service -> /lib/systemd/system/postfix.service
lrwxrwxrwx 1 root root 44 May  4 18:19 remote-cryptsetup.target -> /lib/systemd/system/remote-cryptsetup.target
lrwxrwxrwx 1 root root 36 Oct 10  2023 remote-fs.target -> /lib/systemd/system/remote-fs.target
lrwxrwxrwx 1 root root 45 May  4 18:19 remote-veritysetup.target -> /lib/systemd/system/remote-veritysetup.target
lrwxrwxrwx 1 root root 31 Oct 10  2023 ssh.service -> /lib/systemd/system/ssh.service
root@storj:/etc/systemd/system/multi-user.target.wants#
root@storj:/etc/systemd/system/multi-user.target.wants# sudo systemctl daemon-reload
root@storj:/etc/systemd/system/multi-user.target.wants#
root@storj:/etc/systemd/system/multi-user.target.wants# sudo systemctl enable storagenode
Failed to enable unit: Cannot alias storagenode.service as storagenode.
root@storj:/etc/systemd/system/multi-user.target.wants#
root@storj:/etc/systemd/system/multi-user.target.wants#
root@storj:/etc/systemd/system/multi-user.target.wants#
root@storj:/etc/systemd/system/multi-user.target.wants#
root@storj:/etc/systemd/system/multi-user.target.wants# ls -l
total 0
lrwxrwxrwx 1 root root 32 Oct 10  2023 cron.service -> /lib/systemd/system/cron.service
lrwxrwxrwx 1 root root 40 Oct 10  2023 e2scrub_reap.service -> /lib/systemd/system/e2scrub_reap.service
lrwxrwxrwx 1 root root 38 Oct 10  2023 networking.service -> /lib/systemd/system/networking.service
lrwxrwxrwx 1 root root 43 May  4 18:19 postfix-resolvconf.path -> /lib/systemd/system/postfix-resolvconf.path
lrwxrwxrwx 1 root root 46 May  4 18:19 postfix-resolvconf.service -> /lib/systemd/system/postfix-resolvconf.service
lrwxrwxrwx 1 root root 35 Oct 10  2023 postfix.service -> /lib/systemd/system/postfix.service
lrwxrwxrwx 1 root root 44 May  4 18:19 remote-cryptsetup.target -> /lib/systemd/system/remote-cryptsetup.target
lrwxrwxrwx 1 root root 36 Oct 10  2023 remote-fs.target -> /lib/systemd/system/remote-fs.target
lrwxrwxrwx 1 root root 45 May  4 18:19 remote-veritysetup.target -> /lib/systemd/system/remote-veritysetup.target
lrwxrwxrwx 1 root root 31 Oct 10  2023 ssh.service -> /lib/systemd/system/ssh.service
lrwxrwxrwx 1 root root 39 May 13 09:23 storagenode.service -> /etc/systemd/system/storagenode.service
root@storj:/etc/systemd/system/multi-user.target.wants#

I tried deleting the symlink but it still doesn’t work.

try to remove the alias by

systemctl disable storagenode.service

after that try to reload a daemon and enable storagenode.service back.

Remove

Alias        = storagenode

from the service file.

That’s the issue “cannot alias”.

1 Like

This doesn’t work, same problem

This works

root@storj:/etc/systemd/system# sudo systemctl enable storagenode
Created symlink /etc/systemd/system/multi-user.target.wants/storagenode.service -> /etc/systemd/system/storagenode.service.

Thanks to both of you, I learned a few things about Debian services.

1 Like

Trust me, I know it works based on my reply :wink:

Explanation: You have created a storagenode.service file and aliased that to storagenode. The system tries to enable storagenode(.service) by aliasing storagenode(.service) to storagenode(.service), figures something is wrong since that already exists on the system, freaks out and throws an error.

Aliasing isn’t needed. It has its uses (ie reference a-really-really-really-long-service-that-may-contain-random-numbers-between-the-words.service to wierd.service) but for storj uses you don’t need it. At most you’ll have node1.service, node2.service and so on.

1 Like