Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 403921 - www-servers/nginx-1.0.10 init script should create "/var/tmp/nginx/client"
Summary: www-servers/nginx-1.0.10 init script should create "/var/tmp/nginx/client"
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Benedikt Böhm (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-15 16:33 UTC by Vladimir Berezhnoy
Modified: 2012-07-18 18:59 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Berezhnoy 2012-02-15 16:33:14 UTC
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
Comment 1 Benedikt Böhm (RETIRED) gentoo-dev 2012-02-23 09:49:32 UTC
the ebuild creates these directories and you should not remove them
Comment 2 Tiziano Müller (RETIRED) gentoo-dev 2012-02-23 12:42:35 UTC
wrong, you can't relay on directories being persistent in /var/tmp
The directory must be created in the init.d-script only.
Comment 3 Benedikt Böhm (RETIRED) gentoo-dev 2012-02-23 12:54:28 UTC
according to FHS:

The /var/tmp directory is made available for programs that require temporary files or directories that are preserved between system reboots.
Comment 4 Tiziano Müller (RETIRED) gentoo-dev 2012-02-24 06:38:18 UTC
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)
Comment 5 Vladimir Berezhnoy 2012-02-24 15:03:03 UTC
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
Comment 6 Benedikt Böhm (RETIRED) gentoo-dev 2012-07-18 18:59:32 UTC
i've added the necessary mkdirs to the init script now