Cannot get system mode to setup using systemd.

Hello!

Great Project, thanks!

Ubuntu 12, clean deployment.

Copied: syncthing@.service from github.

Moved file to:

/etc/systemd/system

Renamed file to:

syncthing.sysadmin.service

Executing:

systemctl enable syncthing@sysadmin.service

Output:

The unit files have no installation config (WantedBy=, RequiredBy=, Also=, Alias= settings in the [Install] section, and DefaultInstance= for template units). This means they are not meant to be enabled using systemctl.

Possible reasons for having this kind of units are: • A unit may be statically enabled by being symlinked from another unit’s .wants/ or .requires/ directory. • A unit’s purpose may be to act as a helper for some other unit which has a requirement dependency on it. • A unit may be started when needed via activation (socket, path, timer, D-Bus, udev, scripted systemctl call, …). • In case of template units, the unit is meant to be enabled with some instance name specified.

I tried:

chmod 777 on syncthing.sysadmin.service

Same issue.

Tried using root and sudo. Same issue.

What am I missing please?

Dankie.

This is probably the problem, I’ve never heard this being part of the installation steps. See: Starting Syncthing Automatically — Syncthing documentation

1 Like

Already the copying is likely wrong - from the same docs linked above:

[…] If your distro provides the systemd service files for Syncthing, you can skip step #2 when you’re setting up either the system service or the user service, as described below. If in doubt, try if it works without and go back to step #2 only if enabling the service failed.

[…]

(Skip if your distribution package already installs these files, see above.)

thx for the reply @calmh

I read: Enable and start the service. Replace “myuser” with the actual Syncthing user after the @:

So I’ve replaced “myuser” with the privileged “sysadmin” user.

Anyway, I copied a new file:

cp /root/Sync/syncthing@.service /etc/systemd/system

Then executed as “root” (also tried as “sysadmin”):

systemctl enable syncthing@.service

Output:

The unit files have no installation config (WantedBy=, RequiredBy=, Also= …

Not sure I understand…?

Hi @imsodin,

I checked the dir /etc/systemd/system first to determine if there was any syncthing* file/s. Nothing. Therefore I downloaded the file from Github repo to:

/root/Sync/syncthing@.service

and then copied the file to:

/etc/systemd/system/syncthing@.service

What am I doing wrong?

Appreciate the help!

Dankie!

They don’t need to be there. Did you install using apt?
If yes remove everything you copied to /etc/..., and follow the steps in the linked doc. Especially: Skip step 2: Starting Syncthing Automatically — Syncthing documentation

@imsodin thx for the prompt feedback man!

Ok, I have removed the file I copied to /etc/...

Executed:

systemctl enable syncthing@.service OK

then Executed:

systemctl start syncthing@.service OK

then Executed:

systemctl status syncthing@sysadmin.service OK

syncthing@sysadmin.service - Syncthing - Open Source Continuous File Synchronization for sysadmin Loaded: loaded (/lib/systemd/system/syncthing@.service; enabled; vendor preset: enabled) Active: active (running)

Just running a few backups quickly when I will reboot the box and see if the service starts automatically without login.

Thx!

You probably mean you ran:

systemctl enable syncthing@sysadmin.service

systemctl start syncthing@sysadmin.service

Ah yes sorry, you are right @imsodin :slight_smile:

1 Like

Just wanted to clarify if someone later happens to read this and might be confused. Glad it’s working now for you!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.