Failed to enable unit: Unit WoL.service does not exist

So, the command sudo ethtool enp13s0 | grep Wake-on returned the value d, which means WoL is disabled. I decided to create a service that would run the command ethtool -s enp13s0 wol g. The content of the file /etc/default/WoL.sh:
#!/bin/bash
ethtool -s enp13s0 wol g
#!/bin/bash
ethtool -s enp13s0 wol g
Execution permission was granted. The content of the file /etc/systemd/system/WoL.service with permissions 775:
[Unit]
Description=Enabling WoL

[Service]
#path to our program
ExecStart=/etc/default/WoL.sh
Type=oneshot
[Install]
WantedBy=default.target
[Unit]
Description=Enabling WoL

[Service]
#path to our program
ExecStart=/etc/default/WoL.sh
Type=oneshot
[Install]
WantedBy=default.target
When trying to activate the service with the command sudo systemctl enable WoL.service, I get the error Failed to enable unit: Unit file service does not exist. What am I doing wrong?
Solution:
Ok, fine, I copied the contents of the service, deleted the file and created it via terminal using sudo nano. Now the system sees it and turns it on. Judging by the properties of the file, the permissions are exactly the same as they were. Why it worked now, I have no idea
Jump to solution
11 Replies
Грюндик
ГрюндикOP2w ago
The thing is, the exact same files worked in nobara
asen23
asen232w ago
did you reload systemctl?
DefiniteIntegral
Yeah try sudo systemctl daemon-reload and then try enabling it again
Грюндик
ГрюндикOP2w ago
Yes, of course.
asen23
asen232w ago
hmm thats weird, try using lowercase for the service file
Грюндик
ГрюндикOP2w ago
wol.service?
asen23
asen232w ago
yeah also when enabling iirc you dont need to type the .service extension
Грюндик
ГрюндикOP2w ago
It didn't work
asen23
asen232w ago
can you give me the full step on how you do it? i just tried it myself and it worked
Грюндик
ГрюндикOP2w ago
Well, downloaded these files from my google drive. I used sudo mv to move them from the "downloads" folder to where they should be.
Solution
Грюндик
Ok, fine, I copied the contents of the service, deleted the file and created it via terminal using sudo nano. Now the system sees it and turns it on. Judging by the properties of the file, the permissions are exactly the same as they were. Why it worked now, I have no idea

Did you find this page helpful?