Skip to content

As a Service

Systemd is system and service manager that is used by most popular linux distros including Ubuntu, Fedora, Pop!_OS, Debian, and Arch.

This setup will create a user service that runs on login.

Create a new service file for multi-scrobbler under your HOME config:

Terminal window
mkdir -p ~/.config/systemd/user
touch ~/.config/systemd/user/multi-scrobbler.service

In a text editor add contents below to the file you created, multi-scrobbler.service:

multi-scrobbler.service
[Unit]
Description=multi-scrobbler
After=network.target
[Service]
Type=simple
WorkingDirectory=/path/to/multi-scrobbler/directory
ExecStart=npm run start
Restart=no
[Install]
WantedBy=default.target

Save the file then run:

Terminal window
systemctl daemon-reload
systemctl --user enable multi-scrobbler.service
systemctl --user start multi-scrobbler.service

This will

  • scan for new services and pickup our multi-scrobbler user service
  • enable the service to run at login automatically
  • start the service now

Open a PR if you would like to document setting up multi-scrobbler for other service managers!