Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[NGINX] restart ? (résolu)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
ibasaw
Tux's lil' helper
Tux's lil' helper


Joined: 27 Aug 2006
Posts: 130
Location: France

PostPosted: Tue Apr 17, 2012 3:42 pm    Post subject: [NGINX] restart ? (résolu) Reply with quote

Salut,

J'ai mis a jour nginx et maintenant il me dit:

Code:

 # /etc/init.d/nginx restart
 * ERROR:  nginx does not have a start function.

 nginx -V
nginx version: nginx/1.0.14
TLS SNI support enabled
configure arguments: --prefix=/usr --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error_log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --user=nginx --group=nginx --with-cc-opt=-I/usr/include --with-ld-opt=-L/usr/lib --http-log-path=/var/log/nginx/access_log --http-client-body-temp-path=/var/tmp/nginx/client --http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi --http-scgi-temp-path=/var/tmp/nginx/scgi --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --with-ipv6 --with-pcre --without-http_autoindex_module --without-http_browser_module --without-http_charset_module --without-http_empty_gif_module --without-http_fastcgi_module --without-http_geo_module --without-http_limit_req_module --without-http_limit_zone_module --without-http_map_module --without-http_memcached_module --without-http_referer_module --without-http_scgi_module --without-http_ssi_module --without-http_split_clients_module --without-http_upstream_ip_hash_module --without-http_userid_module --without-http_uwsgi_module --with-http_stub_status_module --with-http_ssl_module --without-mail_imap_module --without-mail_pop3_module --without-mail_smtp_module




Impossible de le relancer...j'ose pas faire un kill -HUP "IDproccessmasternginx" de peur de ne pas le relancer....

Comment je fais pour le relancer ?

Merci
A++


Last edited by ibasaw on Thu Apr 19, 2012 11:53 am; edited 1 time in total
Back to top
View user's profile Send private message
El_Goretto
Moderator
Moderator


Joined: 29 May 2004
Posts: 3169
Location: Paris

PostPosted: Tue Apr 17, 2012 3:44 pm    Post subject: Reply with quote

Tu vérifies la tronche de ton script init? :) (genre là je viens de découvrir la fonction update... on en apprend tous les jours)
Tu fais un etc-update/dispatch-conf propre?
_________________
-TrueNAS & jails: µ-serv Gen8 E3-1260L, 16Go ECC + µ-serv N40L, 10Go ECC
-Réseau: APU2C4 (OpenWRT) + GS726Tv3 + 2x GS108Tv2 + Archer C5v1 (OpenWRT)
Back to top
View user's profile Send private message
ibasaw
Tux's lil' helper
Tux's lil' helper


Joined: 27 Aug 2006
Posts: 130
Location: France

PostPosted: Tue Apr 17, 2012 3:54 pm    Post subject: Reply with quote

J'ai bien fais update avec etc-update: il a donc ecraser le fichier de conf init

voila le contenu de mon init

Code:

#!/sbin/runscript
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/www-servers/nginx/files/nginx.initd,v 1.1 2012/02/11 10:17:30 hollow Exp $

extra_commands="configtest"
extra_started_commands="upgrade reload"

description="Robust, small and high performance http and reverse proxy server"
description_configtest="Run nginx' internal config check."
description_upgrade="Upgrade the nginx binary without losing connections."
description_reload="Reload the nginx configuration without losing connections."

nginx_config="/etc/nginx/nginx.conf"

command="/usr/sbin/nginx"
command_args="-c ${nginx_config}"
pidfile="/var/run/nginx.pid"

depend() {
   need net
   use dns logger netmount
}

start_pre() {
   if [ "${RC_CMD}" != "restart" ]; then
      configtest || return 1
   fi
}

stop_pre() {
   if [ "${RC_CMD}" = "restart" ]; then
      configtest || return 1
   fi
}

stop_post() {
   rm -f ${pidfile}
}

reload() {
   configtest || return 1
   ebegin "Refreshing nginx' configuration"
   kill -HUP `cat ${pidfile}` &>/dev/null
   eend $? "Failed to reload nginx"
}

upgrade() {
   configtest || return 1
   ebegin "Upgrading nginx"

   einfo "Sending USR2 to old binary"
   kill -USR2 `cat ${pidfile}` &>/dev/null

   einfo "Sleeping 3 seconds before pid-files checking"
   sleep 3

   if [ ! -f ${pidfile}.oldbin ]; then
      eerror "File with old pid not found"
      return 1
   fi

   if [ ! -f ${pidfile} ]; then
      eerror "New binary failed to start"
      return 1
   fi

   einfo "Sleeping 3 seconds before WINCH"
   sleep 3 ; kill -WINCH `cat ${pidfile}.oldbin`

   einfo "Sending QUIT to old binary"
   kill -QUIT `cat ${pidfile}.oldbin`

   einfo "Upgrade completed"
   eend $? "Upgrade failed"
}

configtest() {
   ebegin "Checking nginx' configuration"
   ${command} -c ${nginx_config} -t -q

   if [ $? -ne 0 ]; then
      ${command} -c ${nginx_config} -t
   fi

   eend $? "failed, please correct errors above"
}



pourquoi j'ai pas de start, restart, ... ???
Back to top
View user's profile Send private message
guilc
Bodhisattva
Bodhisattva


Joined: 15 Nov 2003
Posts: 3326
Location: Paris - France

PostPosted: Tue Apr 17, 2012 4:54 pm    Post subject: Reply with quote

Tu n'as pas ces commandes car ce sont les fonctions "standard".
Elles sont conditionnées par les variables :
Code:
command="/usr/sbin/nginx"
command_args="-c ${nginx_config}"
pidfile="/var/run/nginx.pid"

A tout hasard, quelle est ta version d'openrc ? C'est elle qui doit prendre en charge ces fonctions par défaut, dans le fichier /lib/rc/sh/runscript.sh.
C'est un fonctionnement assez nouveau, il n'existe pas dans les openrc trop vieux...

[Edit] complément d'info
[Edit2] Bon en fait non, c'est assez vieux comme fonctionnement, ça date de 2008-2009... C'est juste que c'est pas souvent utilisé par les scripts d'init...
_________________
Merci de respecter les règles du forum.

Mon site perso : https://www.xwing.info
Mon PORTDIR_OVERLAY : https://gentoo.xwing.info ou layman -a xwing
Back to top
View user's profile Send private message
ibasaw
Tux's lil' helper
Tux's lil' helper


Joined: 27 Aug 2006
Posts: 130
Location: France

PostPosted: Wed Apr 18, 2012 7:57 am    Post subject: Reply with quote

J'ai pas encore fait la migration, cela doit être a cause de ça...j'ai un vieux openrc
Back to top
View user's profile Send private message
ibasaw
Tux's lil' helper
Tux's lil' helper


Joined: 27 Aug 2006
Posts: 130
Location: France

PostPosted: Wed Apr 18, 2012 1:24 pm    Post subject: Reply with quote

Je vais essayer de mettre a jour, je vous tiens au courant...
Back to top
View user's profile Send private message
guilc
Bodhisattva
Bodhisattva


Joined: 15 Nov 2003
Posts: 3326
Location: Paris - France

PostPosted: Wed Apr 18, 2012 3:47 pm    Post subject: Reply with quote

ZuckBin wrote:
J'ai pas encore fait la migration, cela doit être a cause de ça...j'ai un vieux openrc

Hein ??? Tu es encore en baselayout 1 ???
Alors oui, ne cherche pas plus loin, ça vient de là. baselayout 1 a été supprimé de portage il y a plus de 6 mois quand même ! (déput septembre 2011)
Et baselayout 2 a été stabilisé il y a... 1 an :lol:
_________________
Merci de respecter les règles du forum.

Mon site perso : https://www.xwing.info
Mon PORTDIR_OVERLAY : https://gentoo.xwing.info ou layman -a xwing
Back to top
View user's profile Send private message
ibasaw
Tux's lil' helper
Tux's lil' helper


Joined: 27 Aug 2006
Posts: 130
Location: France

PostPosted: Thu Apr 19, 2012 11:54 am    Post subject: Reply with quote

après la maj de Gentoo, c'est tout bon.....merci ;)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum