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
User avatar
GarryRicketson
 
Posts: 4814
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.
User avatar
GarryRicketson
 
Posts: 4814
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
"Il semble que la perfection soit atteinte non quand il n'y a plus rien à ajouter, mais quand il n'y a plus rien à retrancher."
— Antoine de Saint Exupéry, Terre des Hommes (1939).
User avatar
Head_on_a_Stick
 
Posts: 7571
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*
"Il semble que la perfection soit atteinte non quand il n'y a plus rien à ajouter, mais quand il n'y a plus rien à retrancher."
— Antoine de Saint Exupéry, Terre des Hommes (1939).
User avatar
Head_on_a_Stick
 
Posts: 7571
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 :(
"Il semble que la perfection soit atteinte non quand il n'y a plus rien à ajouter, mais quand il n'y a plus rien à retrancher."
— Antoine de Saint Exupéry, Terre des Hommes (1939).
User avatar
Head_on_a_Stick
 
Posts: 7571
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.
"Il semble que la perfection soit atteinte non quand il n'y a plus rien à ajouter, mais quand il n'y a plus rien à retrancher."
— Antoine de Saint Exupéry, Terre des Hommes (1939).
User avatar
Head_on_a_Stick
 
Posts: 7571
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

Re: Cannot unmask samba.service

Postby neodeb » 2018-03-13 15:01

At normal dist-upgrade: First I get errors...
Segmentation fault
dpkg: error processing package python-samba (--configure):
subprocess installed post-installation script returned error exit status 139
Setting up samba-common (2:4.5.12+dfsg-2+deb9u2) ...
Setting up libsmbclient:amd64 (2:4.5.12+dfsg-2+deb9u2) ...
Setting up smbclient (2:4.5.12+dfsg-2+deb9u2) ...
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Processing triggers for systemd (232-25+deb9u2) ...
Processing triggers for man-db (2.7.6.1-2) ...
dpkg: dependency problems prevent configuration of samba:
samba depends on python-samba; however:
Package python-samba is not configured yet.

dpkg: error processing package samba (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of samba-common-bin:
samba-common-bin depends on python-samba; however:
Package python-samba is not configured yet.

dpkg: error processing package samba-common-bin (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of winbind:
winbind depends on samba-common-bin (= 2:4.5.12+dfsg-2+deb9u2); however:
Package samba-common-bin is not configured yet.

dpkg: error processing package winbind (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libpam-winbind:amd64:
libpam-winbind:amd64 depends on winbind (= 2:4.5.12+dfsg-2+deb9u2); however:
Package winbind is not configured yet.

dpkg: error processing package libpam-winbind:amd64 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libnss-winbind:amd64:
libnss-winbind:amd64 depends on winbind (= 2:4.5.12+dfsg-2+deb9u2); however:
Package winbind is not configured yet.

dpkg: error processing package libnss-winbind:amd64 (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
python-samba
samba
samba-common-bin
winbind
libpam-winbind:amd64
libnss-winbind:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

Then I simply try dist-upgrading (stable) again...
Setting up python-samba (2:4.5.12+dfsg-2+deb9u2) ...
Setting up samba-common-bin (2:4.5.12+dfsg-2+deb9u2) ...
Setting up winbind (2:4.5.12+dfsg-2+deb9u2) ...
Setting up libpam-winbind:amd64 (2:4.5.12+dfsg-2+deb9u2) ...
Setting up samba (2:4.5.12+dfsg-2+deb9u2) ...
Failed to preset unit: Unit file /etc/systemd/system/samba-ad-dc.service is masked.
/usr/bin/deb-systemd-helper: error: systemctl preset failed on samba-ad-dc.service: No such file or directory
Setting up libnss-winbind:amd64 (2:4.5.12+dfsg-2+deb9u2) ...
Processing triggers for libc-bin (2.24-11+deb9u3) ...
W: APT had planned for dpkg to do more than it reported back (15 vs 19).
Affected packages: python-samba:amd64

I note the changed way to:
systemctl status smbd
● smbd.service - Samba SMB Daemon
Loaded: loaded (/lib/systemd/system/smbd.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2018-03-13 11:23:55 EDT; 11min ago
Docs: man:smbd(8)
man:samba(7)
man:smb.conf(5)
Main PID: 4870 (smbd)
Status: "smbd: ready to serve connections..."
Tasks: 4 (limit: 4915)
CGroup: /system.slice/smbd.service
├─4870 /usr/sbin/smbd
├─4871 /usr/sbin/smbd
├─4872 /usr/sbin/smbd
└─4877 /usr/sbin/smbd

Then I tried:
systemctl unmask samba-ad-dc.service

So the 3rd time I upgraded it had nothing to do. As if no problems.
Now I thought I best try:
systemctl mask samba-ad-dc.service

Is umasking and then masking correct?? Should I leave it masked? What happened?
Open is freedom.
neodeb
 
Posts: 103
Joined: 2007-08-09 02:49


Return to System configuration

Who is online

Users browsing this forum: No registered users and 6 guests

fashionable