Cannot unmask samba.service

Kernels & Hardware, configuring network, installing services

Cannot unmask samba.service

Postby abmacomber » 2015-12-03 01:45

Hello. I am trying to configure samba for a stripped down file server. I am running debian with command line only. My problem is that I cannot unmask samba.

See below:

root@debian:/home/aaron# service samba status
● samba.service
Loaded: masked (/dev/null)
Active: inactive (dead)

I have tried "sudo systemctl unmask samba.service". I recieve no errors however it does not actually unmask.
I can't find anything online regarding a service stuck on masked status.

Please help!
abmacomber
 
Posts: 5
Joined: 2015-12-03 01:33

Re: Cannot unmask samba.service

Postby GarryRicketson » 2015-12-03 02:01

What makes you think it did not "unmask" it ?
In this below, they use "nginx" as the example, but I think it could be applied to "samba.serce" as well, I have never used samba,


https://medium.com/@johannes_gehrs/getting-started-with-systemd-on-debian-jessie-e024758ca63d#.bjq8cqq67

Issuing disable, enable; mask or unmask will not start or stop the service. You need to do this separately.

And there is more on this here :
Cannot unmask samba.service on a Debian system
"What we expect you have already Done"

Before doing anything, read the Debian documentation:
Debian Documentation
How to ask the smart way
Debian Foro Español
======================
For the Birds
User avatar
GarryRicketson
 
Posts: 4725
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Cannot unmask samba.service

Postby abmacomber » 2015-12-03 02:25

I am sure it didnt unmask becuase if I try to start, stop or restart I get this:

root@debian:/home/aaron# service samba restart
Failed to restart samba.service: Unit samba.service is masked.
abmacomber
 
Posts: 5
Joined: 2015-12-03 01:33

Re: Cannot unmask samba.service

Postby GarryRicketson » 2015-12-03 02:56

Oh, ok, well at least we know, this now, that you have tried running the start command as well. ,.. Odd it is not "unmasking",..
Not knowing anything about "samba" , and also I am not much of a expert with systemd, sorry, I couldn't be of more help, .. I do think is one more detail though, that will help, knowing you have tried using the start and restart command, and it confirms it did not "unmask". There are several members here that know a lot more on systemd, etc. Hope fully someone else knows more.
"What we expect you have already Done"

Before doing anything, read the Debian documentation:
Debian Documentation
How to ask the smart way
Debian Foro Español
======================
For the Birds
User avatar
GarryRicketson
 
Posts: 4725
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Cannot unmask samba.service

Postby Head_on_a_Stick » 2015-12-03 08:18

Please post the output of:
Code: Select all
ls -lR /etc/systemd/system
"Men are born ignorant, not stupid. They are made stupid by education." — Bertrand Russell
User avatar
Head_on_a_Stick
 
Posts: 7165
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Cannot unmask samba.service

Postby swirler » 2015-12-03 08:39

I'll not be of any help here (sorry), but I've run into this too: as a test, I masked some service that I didn't care about, and then when trying to unmask/restart it no command that I know of could do it.

Luckily it was something I didn't need, I only masked it to test how this worked, but the outcome wasn't good anyways: that service is still masked.
swirler
 
Posts: 166
Joined: 2013-11-24 11:19

Re: Cannot unmask samba.service

Postby abmacomber » 2015-12-03 16:34

Head_on_a_Stick wrote:Please post the output of:
Code: Select all
ls -lR /etc/systemd/system
e

Here it is:
root@debian:/home/aaron# ls -lR /etc/systemd/system
/etc/systemd/system:
total 28
drwxr-xr-x 2 root root 4096 Dec 1 20:05 getty.target.wants
drwxr-xr-x 2 root root 4096 Dec 1 20:05 halt.target.wants
drwxr-xr-x 2 root root 4096 Dec 1 20:16 multi-user.target.wants
drwxr-xr-x 2 root root 4096 Dec 1 20:07 paths.target.wants
drwxr-xr-x 2 root root 4096 Dec 1 20:05 poweroff.target.wants
drwxr-xr-x 2 root root 4096 Dec 1 20:05 reboot.target.wants
drwxr-xr-x 2 root root 4096 Dec 1 20:07 sockets.target.wants
lrwxrwxrwx 1 root root 31 Dec 1 20:16 sshd.service -> /lib/systemd/system/ssh.service
lrwxrwxrwx 1 root root 35 Dec 1 20:06 syslog.service -> /lib/systemd/system/rsyslog.service

/etc/systemd/system/getty.target.wants:
total 0
lrwxrwxrwx 1 root root 34 Dec 1 20:05 getty@tty1.service -> /lib/systemd/system/getty@.service

/etc/systemd/system/halt.target.wants:
total 0
lrwxrwxrwx 1 root root 40 Dec 1 20:05 hwclock-save.service -> /lib/systemd/system/hwclock-save.service

/etc/systemd/system/multi-user.target.wants:
total 0
lrwxrwxrwx 1 root root 32 Dec 1 20:06 cron.service -> /lib/systemd/system/cron.service
lrwxrwxrwx 1 root root 36 Dec 1 20:05 remote-fs.target -> /lib/systemd/system/remote-fs.target
lrwxrwxrwx 1 root root 35 Dec 1 20:06 rsyslog.service -> /lib/systemd/system/rsyslog.service
lrwxrwxrwx 1 root root 31 Dec 1 20:16 ssh.service -> /lib/systemd/system/ssh.service

/etc/systemd/system/paths.target.wants:
total 0
lrwxrwxrwx 1 root root 30 Dec 1 20:07 acpid.path -> /lib/systemd/system/acpid.path

/etc/systemd/system/poweroff.target.wants:
total 0
lrwxrwxrwx 1 root root 40 Dec 1 20:05 hwclock-save.service -> /lib/systemd/system/hwclock-save.service

/etc/systemd/system/reboot.target.wants:
total 0
lrwxrwxrwx 1 root root 40 Dec 1 20:05 hwclock-save.service -> /lib/systemd/system/hwclock-save.service

/etc/systemd/system/sockets.target.wants:
total 0
lrwxrwxrwx 1 root root 32 Dec 1 20:07 acpid.socket -> /lib/systemd/system/acpid.socket
root@debian:/home/aaron#
abmacomber
 
Posts: 5
Joined: 2015-12-03 01:33

Re: Cannot unmask samba.service

Postby Head_on_a_Stick » 2015-12-03 19:03

OK, how about:
Code: Select all
ls -l /lib/systemd/system/samba*
"Men are born ignorant, not stupid. They are made stupid by education." — Bertrand Russell
User avatar
Head_on_a_Stick
 
Posts: 7165
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Cannot unmask samba.service

Postby abmacomber » 2015-12-03 20:35

Here is the result:

aaron@debian:~$ ls -l /lib/systemd/system/samba*
lrwxrwxrwx 1 root root 9 Mar 7 2015 /lib/systemd/system/samba.service -> /dev/null
abmacomber
 
Posts: 5
Joined: 2015-12-03 01:33

Re: Cannot unmask samba.service

Postby Head_on_a_Stick » 2015-12-03 20:45

I think what has happened here is that at some point you have used:
Code: Select all
# systemctl mask samba.service

I have never used samba but it looks like the .service is called smbd.service so you have created a masking symlink in the unit file folder to a non-existent .service.

I think you can just delete the symlink at /lib/systemd/system/samba.service but perhaps you should wait for somebody who actually does use samba.

EDIT: and I don't have a Debian system until the weekend so I can't check anything :(
"Men are born ignorant, not stupid. They are made stupid by education." — Bertrand Russell
User avatar
Head_on_a_Stick
 
Posts: 7165
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Cannot unmask samba.service

Postby abmacomber » 2015-12-03 22:51

I deleted samba.service, ran the unmask command again and it now works. Thanks everyone!
abmacomber
 
Posts: 5
Joined: 2015-12-03 01:33

Re: Cannot unmask samba.service

Postby Head_on_a_Stick » 2015-12-04 22:50

Good stuff!

Please add "[SOLVED]" to the start of the thread title (in your first post) to help others with this problem.
"Men are born ignorant, not stupid. They are made stupid by education." — Bertrand Russell
User avatar
Head_on_a_Stick
 
Posts: 7165
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Cannot unmask samba.service

Postby swirly_cloud » 2015-12-08 20:29

For people going through this topic and looking for further information. It might be worth taking a look at: http://forums.debian.net/viewtopic.php?f=5&t=126076.

I have included a few different links about bug reports and other content.

To sum up, the samba.service unit is supposed to be masked and the smbd.service and nmbd.service units are the ones that should be restarted to reload daemon configuration by restarting the server.
User avatar
swirly_cloud
 
Posts: 69
Joined: 2015-07-08 04:56
Location: Where sun shines.

Cannot unmask samba.service

Postby kackland » 2018-01-29 20:12

None of this had helped me and like others I think this is very frustrating.

After a day I solved this. I hope it works for your to.

The command sudo systemctl start samba-ad-dc.service
gave me the error of Failed to enable unit: Unit file /etc/systemd/system/samba-ad-dc.service is masked.

I solved it by sudo systemctl unmask samba-ad-dc.service

Not unmask samba but the entire command - this allowed me to continue with the install.

I hope it helps someone
kackland
 
Posts: 1
Joined: 2018-01-29 20:04


Return to System configuration

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable