Why is Samba listening? How started? Safe to Uninstall?

Asked by alienheartbeat on 2014-07-10

Clean install of Kubuntu 14.04.
For comparison I have another machine with Kubuntu 12.04

On 14.04:
. smbd is listening on ports 139, 445.
. samba, samba-common, samba-common-bin, samba-libs, smb-client etc are installed,
and that Samba is 'automatically installed'
. two smbd process are running.

By contrast, in 12.04:
. while some of these were installed the Samba module was not
. also Samba was not listening
. no smbd processes are running.

Also, if I do a sysv-rc-conf: samba, samba-ad-dc and smb are all there but no checkbox to indicate they are started.
Have also chked /usr/share/autostart, /etc/systemd/system, /etc/xdg/autostart.

The apps manually installed on both machines are the same (except for version of course).

So:
1. Is it deliberate that Samba is now installed by default
     (or have I made some setting choice somewhere that caused this to happen).

2. How is smbd being started?
There seems to be a new place to start daemons I am not aware of.

3. Is it safe to uninstall samba, samba-common, samba-common-bin, samba-libs, smb-client etc and winbind?
I never share files with windows machines, and if I happen to find myself near one, I always wash my hands afterwards ;-)

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu samba Edit question
Assignee:
No assignee Edit question
Solved by:
actionparsnip
Solved:
Last query:
Last reply:

If you uninstall samba then it will remove what isn't needed as deps. Samba clients are handy for GUI applications but I don't think the server is installed by default. You can use dpkg to see if it was installed as a dependency of another package or grep for samba in /var/log/dpkg.log to see when it was installed as well as the packages installed with it.

You can also grep all user bash history files to see if it was installed using command line.

thanks for an extremely helpful answer.

Wasn't sure which dpkg option you meant
but:
 sudo dpkg --search "samba"
showed it is started by cron.daily

The dpkg log was too large to pinpoint an answer (8,000 lines on that day)
but pointed to a few plausible offenders.

What eventually turned up the answer was:
 apt-cache --installed rdepends samba

which showed winbind now depends on samba (it didn't in 12.04)
and wine1.6 depends on winbind.

Funny that
 aptitude show wine1.6
and apt-cache show wine1.6
and Muon package manager
all just show that wine1.6 **recommends** winbind
but **does not** depend on it.

Wonder if there is a packaging bug in there?

I checked the wine ppa to see if I could go back to wine 1.4 or 1.5
but they don't seem to be built for 14.04.

So what I might do is after I have configured and tested my progs on wine1.6
is to just uninstall samba and see how it goes.
In any event I can likely remove the cron.daily starting of samba with no ill effects.

Again, thanks for the help.

No worries. If you think this is an oversight then report a bug.

For the benefit of anyone else who may come across the same issue:

I purged samba, which also uninstalled winbind.
After that, smbd processses no longer appeared in process list and were no longer listening on ports.

Wine continued to work.

For good measure, I then also purged smbclient, smb-common, smb-common-bin.

Wine continues to work.

Thanks actionparsnip, that solved my question.