• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue Problem with cron daily: logrotate, cannot reload

Lightcross

New Pleskian
Hello friends.

I received an email from my server which I can not resolve:

```
/etc/cron.daily/logrotate:
smbd.service is not active, cannot reload.
error: error running non-shared postrotate script for /var/log/samba/log.smbd of '/var/log/samba/log.smbd '
run-parts: /etc/cron.daily/logrotate exited with return code 1
```
I searched the web for it:
It is says, that the smbd service is not started. I checked this on the server and indeed, the smbd service is not running.
After starting the service I have got some trouble with faulty configurations and the server stopped responding.
I could fix this problem with the 'Webserver Configuration Troubleshooter' and the server runs without problems.

Now I get again this mails from cron stating that the smbd service is not active.
I don't want to cripple my server again. How should I resolve this issue?

Thank you for your help.

Edit: I am running Plesk Obsidian 18.0.21 on Ubuntu 16.04.6 LTS
 
Last edited:
Do you have a "Plesk file server" installed among Plesk Extensions? If you do, do you need it and use it?

If not, you might opt to simply remove the Plesk file server Extension, then uninstall the OS samba server package. The troublesome cron script should be removed with it.
 
The Plesk File Server Extension is not installed.
I tried to delete samba with following command:
sudo apt-get remove --auto-remove samba

But then this message appears:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'samba' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

But when I run
service --status-all
I can see the samba, samba-ad-dc and smbd services still listed (not running). Even when I restart the server.
 
That's odd. There seem to be a discrepancy between the package database and the OS. Has perhaps samba been installed manually, not through apt?

All this and the fact that you've had issues running it, even to the point of rending your server unresponsive, leads me to the conclusion that something is properly broken here.

An alternative to following this up is to concentrate on simply removing the annoying message. Not ideal, but a short term solution, perhaps. I suggest checking the contents of the /etc/logrotate.d directory. Is there perhaps a configuration file called samba, or similar? And also the contents of /etc/cron.daily...
 
Contents of /etc/logrotate.d/samba
/var/log/samba/log.smbd {
weekly
missingok
rotate 7
postrotate
/etc/init.d/smbd reload > /dev/null
endscript
compress
notifempty
}

/var/log/samba/log.nmbd {
weekly
missingok
rotate 7
postrotate
[ ! -f /var/run/samba/nmbd.pid ] || kill -HUP `cat /var/run/samba/nmbd.pid`
endscript
compress
notifempty
}

Also there is a file samba.disabled in /etc/cron.daily.

Maybe I can check if the service is started before postrotate is triggered?
/var/log/samba/log.smbd {
...
postrotate
{ pidof smbd && /etc/init.d/smbd reload; } > /dev/null
endscript
...
}
 
Back
Top