[systemd-devel] systemctl can start/stop/disable but cannot enable a custom unit
bobafetthotmail
starshipeleven at hotmail.it
Sun Dec 13 10:09:42 PST 2015
Hi, it's me again. :)
I made a systemd unit called "folder2ram.service", with these contents:
------
[Unit]
Description=folder2ram systemd service
[Service]
Type=oneshot
ExecStart=/sbin/folder2ram -mountall
ExecStop=/sbin/folder2ram -umountall
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
-----
/sbin/folder2ram is a shell script, that is, its shebang is #! /bin/sh
If I place the systemd unit in either /lib/systemd/system/ or
/etc/systemd/system/
when I write: "systemctl enable folder2ram"
It returns:
----
Failed to execute operation: Invalid argument
----
But I can start or stop it normally with "systemctl start/stop folder2ram".
This is the output of "systemctl status folder2ram" when stopped:
-----
folder2ram.service - folder2ram systemd service
Loaded: loaded (/lib/systemd/system/folder2ram.service; disabled)
Active: inactive (dead)
-----
This is the output when started:
-----
folder2ram.service - folder2ram systemd service
Loaded: loaded (/lib/systemd/system/folder2ram.service; disabled)
Active: active (exited) since Sun 2015-12-13 18:54:16 CET; 1min 4s ago
Process: 21257 ExecStart=/sbin/folder2ram -mountall (code=exited,
status=0/SUCCESS)
Main PID: 21257 (code=exited, status=0/SUCCESS)
Dec 13 18:54:16 alby-xeon folder2ram[21257]: will now start all mountpoints
-----
I'm on Debian Jessie, using Systemd 215 (the normal Debian Jessie one).
Can someone give me some hints to understand what I'm doing wrong?
Also, could it be possible to have more verbose error text?
Where and/or what is the invalid argument?
Thanks
-Albert
More information about the systemd-devel
mailing list