s ~ # /etc/init.d/nginx start * Checking nginx' configuration ... nginx: [emerg] mkdir() "/var/tmp/nginx/client" failed (2: No such file or directory) nginx: configuration file /etc/nginx/nginx.conf test failed nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: [emerg] mkdir() "/var/tmp/nginx/client" failed (2: No such file or directory) nginx: configuration file /etc/nginx/nginx.conf test failed * failed, please correct errors above [ !! ] * ERROR: nginx failed to start
the ebuild creates these directories and you should not remove them
wrong, you can't relay on directories being persistent in /var/tmp The directory must be created in the init.d-script only.
according to FHS: The /var/tmp directory is made available for programs that require temporary files or directories that are preserved between system reboots.
true, but again from LHS: "Files and directories located in /var/tmp must not be deleted when the system is booted. Although data stored in /var/tmp is typically deleted in a site-specific manner, it is recommended that deletions occur at a less frequent interval than /tmp" thus it can still be the case that files are cleaned up and we should therefore check again in the init.d-script (nginx should do it, but yeah)
I just want to note that other init scripts do some pre-start checks and perform modifications to /etc and /var. For example /etc/init.d/sshd checks for keys in /etc and generates them if they are not present, it also checks for /var/empty and creates if neccessary. On the other hand there are much more of this and apparently I should just stop wiping /var/tmp as I'm used to or configure nginx to use /var/spool instead $ equery f nginx /var/tmp /var/tmp/nginx /var/tmp/nginx/client /var/tmp/nginx/client/.keep_www-servers_nginx-0 /var/tmp/nginx/fastcgi /var/tmp/nginx/fastcgi/.keep_www-servers_nginx-0 /var/tmp/nginx/proxy /var/tmp/nginx/proxy/.keep_www-servers_nginx-0 /var/tmp/nginx/scgi /var/tmp/nginx/scgi/.keep_www-servers_nginx-0 /var/tmp/nginx/uwsgi /var/tmp/nginx/uwsgi/.keep_www-servers_nginx-0
i've added the necessary mkdirs to the init script now