ClearOS Bug Tracker


View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0020961ClearOSapp-base - Base Systempublic2018-07-31 03:372018-08-14 11:03
ReporterNickH 
Assigned Topbaldwin 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version7.5.0 
Target Version7.5.0 UpdatesFixed in Version7.5.0 Updates 
Summary0020961: Base app incorrectly triggers smb, nmb and winbind to restart
DescriptionTwice a night every night, I've noticed smb, nmb and winbind restarting. It happens after the anti-spam and anti-malware updates - and possibly after every yum update event.

Tracing the events system back it looks like the error is in the configuration in /var/clearos/events/software_updates/base where the routine is effectively doing a "pidof smb" for the smb process etc. It looks like this is incorrect and the PROCESS_NAME for the services should be smbd, nmbd and winbindd to get pidof to return the correct result.

Changing:
winbind|winbind \
nmb|nmb \
smb|smb \

to:
winbind|winbindd \
nmb|nmbd \
smb|smbd \

will probably fix it but I have not traced the app through thoroughly.

As a secondary tweak, the "service" commands should be updated to the equivalent systemd commands:
"/usr/sbin/service $SERVICE stop" -> "/usr/bin/systemctl stop $SERVICE"
"/usr/sbin/service $SERVICE start" -> "/usr/bin/systemctl start $SERVICE"

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0007701)
NickH (developer)
2018-08-01 02:03

I don't know if it is related but I made what I thought were the required changes to /var/clearos/events/software_updates/base:

PIDOF="/sbin/pidof"
LOGGER="/usr/bin/logger -p local6.notice -t app-base"
# changed smb -> smbd, nmb -> nmbd and winbind -> winbindd by njh
DAEMONS="\
slapd|slapd \
webconfig|webconfig \
clearsync|clearsyncd \
suvad|suvad \
winbind|winbindd \
nmb|nmbd \
smb|smbd \
"
I did not change the "service" command.

And I got failure messages last night:

Aug 1 03:58:04 server app-antimalware-updates: Service requires an update.
Aug 1 03:58:30 server engine: exception: error: /usr/clearos/apps/base/libraries/Shell.php (227): Command execution failed.
Aug 1 03:58:30 server engine: exception: debug backtrace: /usr/clearos/apps/base/libraries/Yum.php (197): execute
Aug 1 03:58:30 server engine: exception: debug backtrace: /usr/clearos/apps/clearcenter/libraries/Application_Web_Service.php (178): install
Aug 1 03:58:30 server engine: exception: debug backtrace: /usr/sbin/clearcenter-update (79): install_update

and:

Aug 1 06:07:04 server app-antispam-updates: Service requires an update.
Aug 1 06:08:28 server engine: exception: error: /usr/clearos/apps/base/libraries/Shell.php (227): Command execution failed.
Aug 1 06:08:28 server engine: exception: debug backtrace: /usr/clearos/apps/base/libraries/Yum.php (197): execute
Aug 1 06:08:28 server engine: exception: debug backtrace: /usr/clearos/apps/clearcenter/libraries/Application_Web_Service.php (178): install
Aug 1 06:08:28 server engine: exception: debug backtrace: /usr/sbin/clearcenter-update (79): install_update

This could be because the last command tested in the script is:
if [ "$PID" == "" ]; then

But this returns a failure code as it does exist and this is the last code seen by the script before it exits so it send a failure code back to the calling program.
(0007711)
NickH (developer)
2018-08-03 02:06
edited on: 2018-08-03 04:02

The previous comment is a red herring. I've changed /var/clearos/events/software_updates/base to:
        if [ "$PID" == "" ]; then
            $LOGGER "sanity checking $SERVICE"
            sleep 3
            PID=`$PIDOF $PROCESS_NAME`
            if [ "$PID" == "" ]; then
                /usr/sbin/service $SERVICE stop
                sleep 2
                /usr/sbin/service $SERVICE start
                $LOGGER "restarting $SERVICE"
            fi
     else
         $LOGGER "service $SERVICE is OK; added by njh"
        fi

In the logs you can see my change working, but you get the messages:
Aug 3 03:26:27 server engine: exception: error: /usr/clearos/apps/base/libraries/Shell.php (227): Command execution failed.
Aug 3 03:26:27 server engine: exception: debug backtrace: /usr/clearos/apps/base/libraries/Yum.php (197): execute
Aug 3 03:26:27 server engine: exception: debug backtrace: /usr/clearos/apps/clearcenter/libraries/Application_Web_Service.php (178): install
Aug 3 03:26:27 server engine: exception: debug backtrace: /usr/sbin/clearcenter-update (79): install_update

after each app-antimalware-updates and app-antimalware-updates anyway with or without my change so there is another bug.

[edit]
... and my systemctl commands are slightly wrong in the initial report. They should be:
/usr/bin/systemctl stop $SERVICE.service
/usr/bin/systemctl start $SERVICE.service
[/edit]


- Issue History
Date Modified Username Field Change
2018-07-31 03:37 NickH New Issue
2018-08-01 02:03 NickH Note Added: 0007701
2018-08-01 09:19 pbaldwin Status new => acknowledged
2018-08-01 09:19 pbaldwin Category app-clearsync - Synchronization and Events => app-base - Base System
2018-08-01 09:19 pbaldwin Summary Clearsync incorrectly triggers smb, nmb and winbind to restart => Base app incorrectly triggers smb, nmb and winbind to restart
2018-08-01 09:20 pbaldwin Target Version => 7.5.0 Updates
2018-08-03 02:06 NickH Note Added: 0007711
2018-08-03 04:02 NickH Note Edited: 0007711 View Revisions
2018-08-14 11:03 pbaldwin Status acknowledged => resolved
2018-08-14 11:03 pbaldwin Fixed in Version => 7.5.0 Updates
2018-08-14 11:03 pbaldwin Resolution open => fixed
2018-08-14 11:03 pbaldwin Assigned To => pbaldwin