Opened 6 years ago

Closed 6 years ago

#561 closed defect (fixed)

error in init.d script in Centos RPM

Reported by: nearvirgo . Owned by:
Priority: minor Milestone:
Component: nginx-package Version:
Keywords: centos rpm init.d Cc:
uname -a:
nginx -V: nginx version: nginx/1.6.0
built by gcc 4.1.2 20080704 (Red Hat 4.1.2-54)
TLS SNI support disabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6 --with-cc-opt='-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables'

Description

The new RPM for centos 5 (and probably all rhel and centos packages) breaks the call to /etc/sysconfig/nginx

Instead of hard-coding this filename in the /etc/init.d/nginx script, a line parses the basename of the file to use for sysconfig using the following command:
sysconfig=/bin/basename $0

This works perfectly if you start nginx with
#service nginx start

But nginx will not call the right sysconfig file while booting, as the basename is "S85nginx" on boot rather than "nginx" (this filename is based on the # chkconfig: - 85 15 command in the init.d file, which sets the default start priority for chkconfig)

I fixed this on my installation by creating the following symlink - but this behavior should probably revert back to the hard-coded value for the sysconfig file.

symlink: /etc/sysconfig/S85nginx --> /etc/sysconfig/nginx
#cd /etc/sysconfig/;ln -s nginx S85nginx

Change History (3)

comment:1 by Sergey Budnevitch, 6 years ago

Status: newaccepted

comment:2 by Sergey Budnevitch, 6 years ago

Thanks. We will build fixed package next week.

comment:3 by Sergey Budnevitch, 6 years ago

Resolution: fixed
Status: acceptedclosed

Stable fixed too.

Note: See TracTickets for help on using tickets.