Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3874

Troubleshooting • failed to start service with log in RAM

$
0
0
Hi , i would like to put the log files in RAM , so in /etc/fstab , iadd this line :

Code:

tmpfs/var/log        tmpfs   defaults,size=100m 
then reboot and i got this now :

Code:

pi@e-pi3:~ $ systemctl list-units --type=service | grep failed● apache2.service                                             loaded failed failed  The Apache HTTP Server● fail2ban.service                                            loaded failed failed  Fail2Ban Service● rc-local.service                                            loaded failed failed  /etc/rc.local Compatibilitypi@e-pi3:~ $
if i commented out the line in /etc/fstab , all work as expected .

Code:

pi@e-pi3:~ $ systemctl status apache2● apache2.service - The Apache HTTP Server     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)     Active: failed (Result: exit-code) since Fri 2024-06-14 10:43:40 CEST; 11min ago       Docs: https://httpd.apache.org/docs/2.4/    Process: 641 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)        CPU: 178msjuin 14 10:43:38 e-pi3 systemd[1]: Starting The Apache HTTP Server...juin 14 10:43:40 e-pi3 apachectl[652]: (2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for mai>juin 14 10:43:40 e-pi3 apachectl[652]: (2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for err>juin 14 10:43:40 e-pi3 apachectl[652]: (2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for err>juin 14 10:43:40 e-pi3 apachectl[652]: AH00014: Configuration check failedjuin 14 10:43:40 e-pi3 apachectl[641]: Action 'start' failed.juin 14 10:43:40 e-pi3 apachectl[641]: The Apache error log may have more information.juin 14 10:43:40 e-pi3 systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILUREjuin 14 10:43:40 e-pi3 systemd[1]: apache2.service: Failed with result 'exit-code'.juin 14 10:43:40 e-pi3 systemd[1]: Failed to start The Apache HTTP Server.pi@e-pi3:~ $
why the apache server can't launch as usually with the logs in RAM ?
why it does not create a log file / directory as other ?

Code:

pi@e-pi3:~ $ ls -l /var/logtotal 324-rw-r----- 1 root   adm      2173 14 juin  10:45 auth.log-rw------- 1 root   root     6393 14 juin  10:43 boot.log-rw-rw---- 1 root   utmp     1152 14 juin  10:45 btmpdrwxr-x--- 2 root   lp         60 14 juin  10:43 cups-rw-r----- 1 root   adm     87517 14 juin  10:57 daemon.log-rw-r----- 1 root   adm      3509 14 juin  10:45 debug-rw-r----- 1 root   adm     29260 14 juin  10:43 kern.log-rw-rw-r-- 1 root   utmp        0 14 juin  10:43 lastlogdrwx--x--x 2 root   root      100 14 juin  10:43 lightdm-rw-r----- 1 root   adm     29575 14 juin  10:45 messagesdrwxr-xr-x 2 pihole pihole     80 14 juin  10:43 piholelrwxrwxrwx 1 pihole pihole     23 14 juin  10:43 pihole-FTL.log -> /var/log/pihole/FTL.loglrwxrwxrwx 1 pihole pihole     26 14 juin  10:43 pihole.log -> /var/log/pihole/pihole.logdrwx------ 2 root   root       40 14 juin  10:43 private-rw-r----- 1 root   adm    118930 14 juin  10:57 syslog-rw-r----- 1 root   adm      1442 14 juin  10:45 user.log-rw-r--r-- 1 root   root     8535 14 juin  10:45 vncserver-x11.log-rw-rw-r-- 1 root   utmp     1920 14 juin  10:45 wtmp-rw-r--r-- 1 root   root     8604 14 juin  10:43 Xorg.0.logpi@e-pi3:~ $ 
Any idea to have apache working with log in RAM please ?


For informations , if i create manually the /var/log/apache2 directory ans restart apache2 , it is working fine .
and :

Code:

pi@e-pi3:~ $ sudo journalctl -b -p err-- Journal begins at Fri 2024-06-14 10:43:29 CEST, ends at Fri 2024-06-14 11:02:47 CEST. --juin 14 10:43:29 e-pi3 systemd[1]: systemd-networkd.socket: Socket service systemd-networkd.service not loaded, refusing.juin 14 10:43:29 e-pi3 systemd[1]: Failed to listen on Network Service Netlink Socket.juin 14 10:43:29 e-pi3 systemd-modules-load[130]: Failed to find module 'lp'juin 14 10:43:29 e-pi3 systemd-modules-load[130]: Failed to find module 'ppdev'juin 14 10:43:29 e-pi3 systemd-modules-load[130]: Failed to find module 'parport_pc'juin 14 10:43:37 e-pi3 ntpd[500]: error resolving pool 0.debian.pool.ntp.org: Temporary failure in name resolution (-3)juin 14 10:43:38 e-pi3 systemd[592]: rc-local.service: Failed to execute /etc/rc.local: Exec format errorjuin 14 10:43:38 e-pi3 systemd[592]: rc-local.service: Failed at step EXEC spawning /etc/rc.local: Exec format errorjuin 14 10:43:38 e-pi3 systemd[1]: Failed to start /etc/rc.local Compatibility.juin 14 10:43:38 e-pi3 ntpd[500]: error resolving pool 1.debian.pool.ntp.org: Temporary failure in name resolution (-3)juin 14 10:43:40 e-pi3 systemd[1]: Failed to start The Apache HTTP Server.juin 14 10:43:43 e-pi3 pipewire[764]: Failed to receive portal pid: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get PID of name 'org.freedesktop.portal.D>juin 14 10:45:38 e-pi3 pipewire[1081]: Failed to receive portal pid: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get PID of name 'org.freedesktop.portal.>pi@e-pi3:~ $

Statistics: Posted by iznobe — Fri Jun 14, 2024 8:52 am



Viewing all articles
Browse latest Browse all 3874

Trending Articles