Forums

Resolved
0 votes
Hi,

Yesterday the server did a reboot. I do not know why (yet). The problem that I had after the boot was that some services didn't start.
I found out that there where directories missing under /var/run. I then recreated the services in order I found the failed services.
/var/run/openldap
/var/run/samba
/var/run/webconfig
/var/run/webconfig-httpd
Now everything seams to be working.
My question now:
- How do I find out if I missed some directories?
- Is there a tool to recreate them all?
- Would the server have healed himself, if I just did a reboot? (I am not a fan of rebooting without knowing the problem first ;))

Thanks for any help
Monday, September 27 2021, 06:52 AM
Share this post:
Responses (4)
  • Accepted Answer

    Monday, September 27 2021, 07:38 AM - #Permalink
    Resolved
    0 votes
    There is no way of telling what is missing under /var/run as each app should set it up itself and there is no simple way of knowing which apps you have and which require a folder there (there may be an rpm command but I don't know it offhand - perhaps "rpm -Va | grep \/run\/" - and note you should not grep /var/run as it is a symlink to /run so some packages may just expect the install to go to /run). Just starting a service may recreate the folder. My list of folders is:
    [root@server run]# ls -d1l */
    drwxr-xr-x 2 amavis amavis 60 Sep 27 04:50 amavisd/
    drwxr-xr-x 2 root root 80 Sep 24 15:23 blkid/
    drwxrwxr-x 2 clam clam 80 Sep 27 03:01 clamav/
    drwxr-xr-x 2 clearsync clearsync 60 Sep 22 04:56 clearsync/
    drwxr-xr-x 2 root root 80 Sep 16 14:11 console/
    drwx------ 2 root root 40 Sep 16 14:10 cryptsetup/
    drwxr-xr-x 2 root root 60 Sep 16 14:10 dbus/
    drwxr-xr-x 2 ddclient ddclient 40 Sep 16 14:10 ddclient/
    drwxr-xr-x 2 root root 80 Sep 21 15:37 fail2ban/
    drwxr-xr-x 2 root root 40 Sep 16 14:10 faillock/
    drwxr-xr-x 2 fetchmail fetchmail 40 Sep 16 14:10 fetchmail/
    drwx--x--- 3 root apache 100 Sep 26 04:31 httpd/
    drwxr-xr-x 2 root root 60 Sep 22 23:40 ibvpn/
    drwxr-xr-x 4 root root 100 Sep 16 14:10 initramfs/
    drwxr-xr-x 2 root root 40 Sep 16 14:10 iptraf-ng/
    drwxr-xr-x 7 root root 180 Sep 27 03:36 lock/
    drwxr-xr-x 3 root root 60 Sep 16 14:10 log/
    drwx------ 2 root root 80 Sep 16 14:10 lvm/
    drwxr-xr-x 2 mysql mysql 40 Sep 16 14:10 mariadb/
    drwx--x--- 2 root root 40 Sep 16 14:10 mdadm/
    drwxr-xr-x 2 root root 40 Sep 16 14:10 mount/
    drwxr-xr-x 2 root root 100 Sep 16 14:10 netifyd/
    drwxr-xr-x 2 root root 60 Sep 24 12:57 netify-fwa/
    drwxrwxr-x 2 root root 40 Sep 16 14:10 netreport/
    drwxr-xr-x 2 root root 80 Sep 16 14:10 nscd/
    drwxr-xr-x 2 nslcd root 80 Sep 16 14:10 nslcd/
    drwx------ 2 opendkim opendkim 40 Sep 16 14:10 opendkim/
    drwxr-xr-x 2 ldap ldap 80 Sep 26 03:13 openldap/
    drwxr-x--- 2 root openvpn 40 Sep 16 14:10 openvpn-client/
    drwxr-x--- 2 root openvpn 40 Sep 16 14:10 openvpn-server/
    drwxr-xr-x 2 root root 80 Sep 17 16:06 pluto/
    drwxr-xr-x 2 root root 40 Sep 16 14:10 plymouth/
    drwxr-xr-x 2 root root 40 Sep 16 14:10 portreserve/
    drwxr-xr-x 2 root root 40 Sep 16 14:10 ppp/
    drwxr-xr-x 2 root root 140 Sep 26 03:13 proftpd/
    drwx--x--- 2 radiusd radiusd 40 Sep 16 14:10 radiusd/
    drwxr-xr-x 5 root root 100 Sep 16 14:11 samba/
    drwxr-xr-x 2 root root 100 Sep 16 14:10 saslauthd/
    drwxrwxr-x 2 root screen 40 Sep 16 14:10 screen/
    drwxr-xr-x 2 root root 40 Sep 16 14:10 sepermit/
    drwxr-xr-x 2 root root 40 Sep 16 14:10 setrans/
    drwx--x--x 3 root root 60 Sep 16 14:10 sudo/
    drwxr-xr-x 2 suva suva 60 Sep 16 14:10 suvad/
    drwx------ 2 root root 40 Sep 16 14:10 svnserve/
    drwxr-xr-x 17 root root 420 Sep 22 04:55 systemd/
    drwxr-xr-x 2 system-mysql system-mysql 60 Sep 16 14:10 system-mariadb/
    drwxr-xr-x 2 root root 60 Sep 16 14:10 syswatch/
    drwxr-xr-x 2 root root 60 Sep 16 14:10 tmpfiles.d/
    drwxr-xr-x 2 root root 60 Sep 16 14:10 tuned/
    drwxr-xr-x 7 root root 160 Sep 27 04:05 udev/
    drwxr-xr-x 4 root root 80 Sep 27 08:20 user/
    drwx------ 2 vnstat vnstat 40 Sep 16 14:10 vnstat/
    drwxrwx--- 2 root webconfig 40 Sep 27 08:25 webconfig/
    drwx--x--- 2 root webconfig 80 Sep 26 03:13 webconfig-httpd/
    I've done a long listing as some have non-root ownership and non 0755 permissions.

    Also of concern is why the folders disappeared. Have you run out of space somewhere "df -h"?
    The reply is currently minimized Show
  • Accepted Answer

    Monday, September 27 2021, 12:32 PM - #Permalink
    Resolved
    0 votes
    Hi,

    Thanks for the info. I found some missing directories and recreated them.

    Why they have gone in the first place...I don't know. 40GB are free on the device.
    I think the crash might be the cause. Maybe the FS had an error which got corrected at startup....
    Still searching for the reason of the crash ;)
    The reply is currently minimized Show
  • Accepted Answer

    Monday, September 27 2021, 01:57 PM - #Permalink
    Resolved
    0 votes
    My "rpm -Va | grep \/run\/" produced very little output, so it is possible that the packages create the folder in their post-install scripts (normally it is better to package the folder rather than create it in a post-install script, but I think many apps still create them in the post-install scripts. Just try "rpm -qa --scripts | grep \/run\/") or in their start up scripts.
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, September 28 2021, 09:02 AM - #Permalink
    Resolved
    0 votes
    Thanks again. Found some more missing dirs with "rpm -qa --scripts | grep \/run\/"

    I think everything is now in place again.

    Thanks Again
    The reply is currently minimized Show
Your Reply