vab Posted February 10, 2018 Posted February 10, 2018 Hello. I have "Debian GNU/Linux 9 (stretch)" on CubieTruck. After installing Apache2 i get problems with /var folder (that is symlink on hdd folder). Apache2 dont see files in it. So i print stat for this folder from commandline and from php in Apache. That is from command line: root@cubietruck:/mnt/var/armbian/apache2/www/html# stat /mnt/var/armbian/var File: /mnt/var/armbian/var Size: 4096 Blocks: 8 IO Block: 4096 directory Device: 801h/2049d Inode: 2097154 Links: 13 Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2018-02-10 14:35:14.025501481 +0300 Modify: 2018-02-04 09:15:43.851540893 +0300 Change: 2018-02-04 09:15:43.851540893 +0300 Birth: - That is from Apache2 File: /mnt/var/armbian/var Size: 4096 Blocks: 8 IO Block: 4096 directory Device: 801h/2049d Inode: 2230756 Links: 2 Access: (1777/drwxrwxrwt) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2018-02-10 15:01:32.557383721 +0300 Modify: 2018-02-09 15:38:21.581012744 +0300 Change: 2018-02-09 15:38:21.581012744 +0300 Birth: - It seems that these are two different folders. I thought that because of tmpfiles.d, but I do not see any using of /var folder there (only its subfolders). Orient me please, how I can determine what process do this. Or may be somebody already solved similar problems. Thank you.
vab Posted February 10, 2018 Author Posted February 10, 2018 (edited) Update: fantom /var folder are changed after restart of Apache2. With inode number i have found folders. root@cubietruck:/mnt/var/armbian/var/tmp# ls -l total 12 drwx------ 3 root root 4096 фев 10 16:55 systemd-private-c39fdc92c0e249339c8c9c86e133aec6-apache2.service-EKP58e drwx------ 3 root root 4096 фев 8 17:47 systemd-private-c39fdc92c0e249339c8c9c86e133aec6-dovecot.service-K64yjF drwx------ 3 root root 4096 фев 6 18:10 systemd-private-c39fdc92c0e249339c8c9c86e133aec6-haveged.service-cFoGr4 At least apache2 and dovecot work incorrectly. I have not dealt with the third one yet. What service can do that? Edited February 10, 2018 by vab rectification
vab Posted February 10, 2018 Author Posted February 10, 2018 When i set up PrivetTmp=false in /lib/systemd/system/apache2.service then Apache2 sees right /var folder. But then Apache has access to all /tmp files. That is not good. Is there some place in systemd where necessary changes can be done. As i understand /var is not temp folder. But Systemd considers it temporary.
vab Posted February 11, 2018 Author Posted February 11, 2018 The problem is solved. The systemd works erroneously with the PrivetTmp=true when /var is a symlink. Instead of mapping an empty disk to /var/tmp systemd maps it to /var.
Recommended Posts