1

Тема: WARNING: failed to start nginx

Всем привет! Люди подскажите что мне сделать с грядущей проблемой, у меня при запуске сервера не запускается nginx

rc.conf

ifconfig_vr0="inet 192.168.10.1  netmask 255.255.255.0"
hostname="gardnet"
nginx_enable="YES"
gateway_enable="YES"
mac_enable="YES"
#keymap="ru.koi8-r"
sshd_enable="YES"
#natd_enable="YES"
firewall_enable="YES"
firewall_nat_enable="YES"
mysql_enable="YES"
xbtt_enable="YES"
memcached_enable="YES"
memcached_flags="-d -l 127.0.0.1"
memcached_user="www"
php_fpm_enable="YES"
# mail
exim_enable="YES"
dovecot_enable="YES"
sendmail_submit_enable="NO"
xbtt_path="/usr/local/xbtt"
#vsftpd_enable="YES"
opentracker_enable="YES"
opentracker_config=/usr/local/etc/opentracker/opentracker.conf
mbmon_enable=YES
#Ethernet
ifconfig_nfe0="DHCP"
defaultrouter="**.***.***.*"

Mar  8 10:56:28 gardnet reboot: rebooted by root
Mar  8 10:56:28 gardnet syslogd: exiting on signal 15
Mar  8 11:05:38 gardnet syslogd: kernel boot file is /boot/kernel/kernel
Mar  8 11:05:38 gardnet kernel: Copyright (c) 1992-2009 The FreeBSD Project.
Mar  8 11:05:38 gardnet kernel: Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
Mar  8 11:05:38 gardnet kernel: The Regents of the University of California. All rights reserved.
Mar  8 11:05:38 gardnet kernel: FreeBSD is a registered trademark of The FreeBSD Foundation.
Mar  8 11:05:38 gardnet kernel: FreeBSD 8.0-RELEASE-p2 #2: Mon Jan 30 06:28:09 UTC 2012
Mar  8 11:05:38 gardnet kernel: root@gardnet:/usr/src/sys/amd64/compile/GENERIC
Mar  8 11:05:38 gardnet kernel: Timecounter "i8254" frequency 1193182 Hz quality 0
Mar  8 11:05:38 gardnet kernel: CPU: AMD Athlon(tm) 64 Processor 3200+ (2010.31-MHz K8-class CPU)
Mar  8 11:05:38 gardnet kernel: Origin = "AuthenticAMD"  Id = 0x20ff2  Stepping = 2
Mar  8 11:05:38 gardnet kernel: Features=0x78bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2>
Mar  8 11:05:38 gardnet kernel: Features2=0x1<SSE3>
Mar  8 11:05:38 gardnet kernel: AMD Features=0xe2500800<SYSCALL,NX,MMX+,FFXSR,LM,3DNow!+,3DNow!>
Mar  8 11:05:38 gardnet kernel: AMD Features2=0x1<LAHF>
Mar  8 11:05:38 gardnet kernel: real memory  = 4294967296 (4096 MB)
Mar  8 11:05:38 gardnet kernel: avail memory = 4107034624 (3916 MB)
Mar  8 11:05:38 gardnet kernel: ACPI APIC Table: <GBT    NVDAACPI>
Mar  8 11:05:38 gardnet kernel: ioapic0 <Version 1.1> irqs 0-23 on motherboard
Mar  8 11:05:38 gardnet kernel: kbd1 at kbdmux0
Mar  8 11:05:38 gardnet kernel: acpi0: <GBT NVDAACPI> on motherboard
Mar  8 11:05:38 gardnet kernel: acpi0: [ITHREAD]
Mar  8 11:05:38 gardnet kernel: acpi0: Power Button (fixed)
Mar  8 11:05:38 gardnet kernel: acpi0: reservation of 290, 5 (4) failed
Mar  8 11:05:38 gardnet kernel: acpi0: reservation of 0, a0000 (3) failed
Mar  8 11:05:38 gardnet kernel: acpi0: reservation of 100000, cfef0000 (3) failed
Mar  8 11:05:38 gardnet kernel: Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000
Mar  8 11:05:38 gardnet kernel: acpi_timer0: <24-bit timer at 3.579545MHz> port 0x1008-0x100b on acpi0
Mar  8 11:05:38 gardnet kernel: acpi_button0: <Power Button> on acpi0
Mar  8 11:05:38 gardnet kernel: pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
Mar  8 11:05:38 gardnet kernel: pci0: <ACPI PCI bus> on pcib0
Mar  8 11:05:38 gardnet kernel: pci0: <memory> at device 0.0 (no driver attached)
Mar  8 11:05:38 gardnet kernel: isab0: <PCI-ISA bridge> at device 1.0 on pci0
Mar  8 11:05:38 gardnet kernel: isa0: <ISA bus> on isab0
Mar  8 11:05:38 gardnet kernel: pci0: <serial bus, SMBus> at device 1.1 (no driver attached)
Mar  8 11:05:38 gardnet kernel: ohci0: <OHCI (generic) USB controller> mem 0xf4102000-0xf4102fff irq 21 at device 2.0 on pci0
Mar  8 11:05:38 gardnet kernel: ohci0: [ITHREAD]
Mar  8 11:05:38 gardnet kernel: usbus0: <OHCI (generic) USB controller> on ohci0
Mar  8 11:05:38 gardnet kernel: ehci0: <NVIDIA nForce4 USB 2.0 controller> mem 0xfeb00000-0xfeb000ff irq 22 at device 2.1 on pci0
Mar  8 11:05:38 gardnet kernel: ehci0: [ITHREAD]
Mar  8 11:05:38 gardnet kernel: usbus1: EHCI version 1.0
Mar  8 11:05:38 gardnet kernel: usbus1: <NVIDIA nForce4 USB 2.0 controller> on ehci0
Mar  8 11:05:38 gardnet kernel: pci0: <multimedia, audio> at device 4.0 (no driver attached)
Mar  8 11:05:38 gardnet kernel: atapci0: <nVidia nForce CK804 UDMA133 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xf000-0xf00f at device 6.0 on pci0
Mar  8 11:05:38 gardnet kernel: ata0: <ATA channel 0> on atapci0
Mar  8 11:05:38 gardnet kernel: ata0: [ITHREAD]
Mar  8 11:05:38 gardnet kernel: ata1: <ATA channel 1> on atapci0
Mar  8 11:05:38 gardnet kernel: ata1: [ITHREAD]
Mar  8 11:05:38 gardnet kernel: atapci1: <nVidia nForce CK804 SATA300 controller> port 0x9f0-0x9f7,0xbf0-0xbf3,0x970-0x977,0xb70-0xb73,0xcc00-0xcc0f mem 0xf4100000-0xf4100fff irq 21 at device 7.0 on pci0
Mar  8 11:05:38 gardnet kernel: atapci1: [ITHREAD]
Mar  8 11:05:38 gardnet kernel: ata2: <ATA channel 0> on atapci1
Mar  8 11:05:38 gardnet kernel: ata2: [ITHREAD]
Mar  8 11:05:38 gardnet kernel: ata3: <ATA channel 1> on atapci1
Mar  8 11:05:38 gardnet kernel: ata3: [ITHREAD]
Mar  8 11:05:38 gardnet kernel: atapci2: <nVidia nForce CK804 SATA300 controller> port 0x9e0-0x9e7,0xbe0-0xbe3,0x960-0x967,0xb60-0xb63,0xe000-0xe00f mem 0xf4101000-0xf4101fff irq 22 at device 8.0 on pci0
Mar  8 11:05:38 gardnet kernel: atapci2: [ITHREAD]
Mar  8 11:05:38 gardnet kernel: ata4: <ATA channel 0> on atapci2
Mar  8 11:05:38 gardnet kernel: ata4: [ITHREAD]
Mar  8 11:05:38 gardnet kernel: ata5: <ATA channel 1> on atapci2
Mar  8 11:05:38 gardnet kernel: ata5: [ITHREAD]
Mar  8 11:05:38 gardnet kernel: pcib1: <ACPI PCI-PCI bridge> at device 9.0 on pci0
Mar  8 11:05:38 gardnet kernel: pci1: <ACPI PCI bus> on pcib1
Mar  8 11:05:38 gardnet kernel: vr0: <VIA VT6105 Rhine III 10/100BaseTX> port 0x9000-0x90ff mem 0xf4005000-0xf40050ff irq 16 at device 6.0 on pci1
Mar  8 11:05:38 gardnet kernel: vr0: Quirks: 0x0
Mar  8 11:05:38 gardnet kernel: vr0: Revision: 0x8b
Mar  8 11:05:38 gardnet kernel: miibus0: <MII bus> on vr0
Mar  8 11:05:38 gardnet kernel: ukphy0: <Generic IEEE 802.3u media interface> PHY 1 on miibus0
Mar  8 11:05:38 gardnet kernel: ukphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
Mar  8 11:05:38 gardnet kernel: vr0: Ethernet address: 00:22:b0:e1:dc:45
Mar  8 11:05:38 gardnet kernel: vr0: [ITHREAD]
Mar  8 11:05:38 gardnet kernel: fwohci0: <Texas Instruments TSB43AB23> mem 0xf4004000-0xf40047ff,0xf4000000-0xf4003fff irq 19 at device 10.0 on pci1
Mar  8 11:05:38 gardnet kernel: fwohci0: [ITHREAD]
Mar  8 11:05:38 gardnet kernel: fwohci0: OHCI version 1.10 (ROM=1)
Mar  8 11:05:38 gardnet kernel: fwohci0: No. of Isochronous channels is 4.
Mar  8 11:05:38 gardnet kernel: fwohci0: EUI64 00:14:85:00:00:2a:78:fd
Mar  8 11:05:38 gardnet kernel: fwohci0: Phy 1394a available S400, 3 ports.
Mar  8 11:05:38 gardnet kernel: fwohci0: Link S400, max_rec 2048 bytes.
Mar  8 11:05:38 gardnet kernel: firewire0: <IEEE1394(FireWire) bus> on fwohci0
Mar  8 11:05:38 gardnet kernel: dcons_crom0: <dcons configuration ROM> on firewire0
Mar  8 11:05:38 gardnet kernel: dcons_crom0: bus_addr 0xc70c8000
Mar  8 11:05:38 gardnet kernel: fwe0: <Ethernet over FireWire> on firewire0
Mar  8 11:05:38 gardnet kernel: if_fwe0: Fake Ethernet address: 02:14:85:2a:78:fd
Mar  8 11:05:38 gardnet kernel: fwe0: Ethernet address: 02:14:85:2a:78:fd
Mar  8 11:05:38 gardnet kernel: fwip0: <IP over FireWire> on firewire0
Mar  8 11:05:38 gardnet kernel: fwip0: Firewire address: 00:14:85:00:00:2a:78:fd @ 0xfffe00000000, S400, maxrec 2048
Mar  8 11:05:38 gardnet kernel: fwohci0: Initiate bus reset
Mar  8 11:05:38 gardnet kernel: fwohci0: fwohci_intr_core: BUS reset
Mar  8 11:05:38 gardnet kernel: fwohci0: fwohci_intr_core: node_id=0x00000000, SelfID Count=1, CYCLEMASTER mode
Mar  8 11:05:38 gardnet kernel: nfe0: <NVIDIA nForce4 CK804 MCP9 Networking Adapter> port 0xe800-0xe807 mem 0xf4103000-0xf4103fff irq 23 at device 10.0 on pci0
Mar  8 11:05:38 gardnet kernel: miibus1: <MII bus> on nfe0
Mar  8 11:05:38 gardnet kernel: rlphy0: <RTL8201L 10/100 media interface> PHY 1 on miibus1
Mar  8 11:05:38 gardnet kernel: rlphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
Mar  8 11:05:38 gardnet kernel: nfe0: Ethernet address: 00:14:85:2b:58:8d
Mar  8 11:05:38 gardnet kernel: nfe0: [FILTER]
Mar  8 11:05:38 gardnet kernel: pcib2: <ACPI PCI-PCI bridge> at device 11.0 on pci0
Mar  8 11:05:38 gardnet kernel: pci2: <ACPI PCI bus> on pcib2
Mar  8 11:05:38 gardnet kernel: pcib3: <ACPI PCI-PCI bridge> at device 12.0 on pci0
Mar  8 11:05:38 gardnet kernel: pci3: <ACPI PCI bus> on pcib3
Mar  8 11:05:38 gardnet kernel: pcib4: <ACPI PCI-PCI bridge> at device 13.0 on pci0
Mar  8 11:05:38 gardnet kernel: pci4: <ACPI PCI bus> on pcib4
Mar  8 11:05:38 gardnet kernel: pcib5: <ACPI PCI-PCI bridge> at device 14.0 on pci0
Mar  8 11:05:38 gardnet kernel: pci5: <ACPI PCI bus> on pcib5
Mar  8 11:05:38 gardnet kernel: vgapci0: <VGA-compatible display> port 0xa000-0xa07f mem 0xf2000000-0xf2ffffff,0xe0000000-0xefffffff,0xf0000000-0xf1ffffff irq 18 at device 0.0 on pci5
Mar  8 11:05:38 gardnet kernel: atrtc0: <AT realtime clock> port 0x70-0x73 irq 8 on acpi0
Mar  8 11:05:38 gardnet kernel: fdc0: <floppy drive controller> port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on acpi0
Mar  8 11:05:38 gardnet kernel: fdc0: [FILTER]
Mar  8 11:05:38 gardnet kernel: fd0: <1440-KB 3.5" drive> on fdc0 drive 0
Mar  8 11:05:38 gardnet kernel: uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
Mar  8 11:05:38 gardnet kernel: uart0: [FILTER]
Mar  8 11:05:38 gardnet kernel: uart1: <16550 or compatible> port 0x2f8-0x2ff irq 3 on acpi0
Mar  8 11:05:38 gardnet kernel: uart1: [FILTER]
Mar  8 11:05:38 gardnet kernel: ppc0: <Parallel port> port 0x378-0x37f irq 7 on acpi0
Mar  8 11:05:38 gardnet kernel: ppc0: Generic chipset (NIBBLE-only) in COMPATIBLE mode
Mar  8 11:05:38 gardnet kernel: ppc0: [ITHREAD]
Mar  8 11:05:38 gardnet kernel: ppbus0: <Parallel port bus> on ppc0
Mar  8 11:05:38 gardnet kernel: plip0: <PLIP network interface> on ppbus0
Mar  8 11:05:38 gardnet kernel: plip0: [ITHREAD]
Mar  8 11:05:38 gardnet kernel: lpt0: <Printer> on ppbus0
Mar  8 11:05:38 gardnet kernel: lpt0: [ITHREAD]
Mar  8 11:05:38 gardnet kernel: lpt0: Interrupt-driven port
Mar  8 11:05:38 gardnet kernel: ppi0: <Parallel I/O> on ppbus0
Mar  8 11:05:38 gardnet kernel: atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
Mar  8 11:05:38 gardnet kernel: atkbd0: <AT Keyboard> irq 1 on atkbdc0
Mar  8 11:05:38 gardnet kernel: kbd0 at atkbd0
Mar  8 11:05:38 gardnet kernel: atkbd0: [GIANT-LOCKED]
Mar  8 11:05:38 gardnet kernel: atkbd0: [ITHREAD]
Mar  8 11:05:38 gardnet kernel: cpu0: <ACPI CPU> on acpi0
Mar  8 11:05:38 gardnet kernel: powernow0: <Cool`n'Quiet K8> on cpu0
Mar  8 11:05:38 gardnet kernel: orm0: <ISA Option ROM> at iomem 0xd0000-0xd17ff on isa0
Mar  8 11:05:38 gardnet kernel: sc0: <System console> at flags 0x100 on isa0
Mar  8 11:05:38 gardnet kernel: sc0: VGA <16 virtual consoles, flags=0x300>
Mar  8 11:05:38 gardnet kernel: vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
Mar  8 11:05:38 gardnet kernel: Timecounter "TSC" frequency 2010312304 Hz quality 800
Mar  8 11:05:38 gardnet kernel: Timecounters tick every 1.000 msec
Mar  8 11:05:38 gardnet kernel: firewire0: 1 nodes, maxhop <= 0 cable IRM irm(0)  (me)
Mar  8 11:05:38 gardnet kernel: firewire0: bus manager 0
Mar  8 11:05:38 gardnet kernel: IP Filter: v4.1.28 initialized.  Default = pass all, Logging = disabled
Mar  8 11:05:38 gardnet kernel: ipfw2 (+ipv6) initialized, divert enabled, nat enabled, rule-based forwarding enabled, default to deny, logging disabled
Mar  8 11:05:38 gardnet kernel: usbus0: 12Mbps Full Speed USB v1.0
Mar  8 11:05:38 gardnet kernel: usbus1: 480Mbps High Speed USB v2.0
Mar  8 11:05:38 gardnet kernel: ugen0.1: <nVidia> at usbus0
Mar  8 11:05:38 gardnet kernel: uhub0: <nVidia OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0
Mar  8 11:05:38 gardnet kernel: ugen1.1: <nVidia> at usbus1
Mar  8 11:05:38 gardnet kernel: uhub1: <nVidia EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus1
Mar  8 11:05:38 gardnet kernel: acd0: DVDR <HL-DT-ST DVDRAM GSA-H10N/JL10> at ata1-slave UDMA33
Mar  8 11:05:38 gardnet kernel: ad8: 476938MB <Seagate ST3500320AS SD15> at ata4-master SATA150
Mar  8 11:05:38 gardnet kernel: uhub0: 10 ports with 10 removable, self powered
Mar  8 11:05:38 gardnet kernel: Root mount waiting for: usbus1
Mar  8 11:05:38 gardnet last message repeated 3 times
Mar  8 11:05:38 gardnet kernel: uhub1: 10 ports with 10 removable, self powered
Mar  8 11:05:38 gardnet kernel: Trying to mount root from ufs:/dev/ad8s1a
Mar  8 11:05:46 gardnet root: /etc/rc: WARNING: failed to start nginx
Mar  8 11:05:47 gardnet dhclient[795]: connection closed
Mar  8 11:05:47 gardnet dhclient[795]: exiting.
Mar  8 11:05:47 gardnet kernel: ifa_add_loopback_route: insertion failed
Mar  8 11:05:47 gardnet dhclient: New IP Address (nfe0): 78.139.212.45
Mar  8 11:05:47 gardnet dhclient: New Subnet Mask (nfe0): 255.255.254.0
Mar  8 11:05:47 gardnet dhclient: New Broadcast Address (nfe0): 78.139.213.255
Mar  8 11:05:47 gardnet dhclient: New Routers (nfe0): 78.139.212.1
Mar  8 13:43:18 gardnet kernel: pid 1868 (php-fpm), uid 80: exited on signal 11
Mar  8 13:58:29 gardnet kernel: pid 1892 (php-fpm), uid 80: exited on signal 11
Mar  8 14:27:53 gardnet kernel: pid 1863 (php-fpm), uid 80: exited on signal 11
Mar  9 00:45:33 gardnet sshd[2663]: fatal: Read from socket failed: Connection reset by peer
Mar  9 15:20:57 gardnet kernel: pid 1850 (php-fpm), uid 80: exited on signal 11
Mar  9 15:21:27 gardnet kernel: pid 10196 (php-fpm), uid 80: exited on signal 11
Mar  9 16:26:42 gardnet sshd[5869]: fatal: Read from socket failed: Connection reset by peer
Mar 10 13:20:55 gardnet kernel: pid 1876 (php-fpm), uid 80: exited on signal 11
Mar 10 14:31:29 gardnet kernel: pid 1884 (php-fpm), uid 80: exited on signal 11
Mar 10 14:43:10 gardnet kernel: pid 1888 (php-fpm), uid 80: exited on signal 11
Mar 10 14:49:21 gardnet kernel: pid 16632 (php-fpm), uid 80: exited on signal 11
Mar 11 07:15:00 gardnet kernel: pid 1852 (php-fpm), uid 80: exited on signal 11
Mar 11 13:21:09 gardnet kernel: pid 1899 (php-fpm), uid 80: exited on signal 11
Mar 11 16:25:33 gardnet kernel: pid 1859 (php-fpm), uid 80: exited on signal 11
Mar 11 23:58:26 gardnet kernel: Limiting open port RST response from 214 to 200 packets/sec
Mar 11 23:58:33 gardnet kernel: Limiting open port RST response from 210 to 200 packets/sec
Mar 12 06:43:09 gardnet kernel: pid 1926 (php-fpm), uid 80: exited on signal 11
Mar 12 08:47:09 gardnet kernel: pid 1887 (php-fpm), uid 80: exited on signal 11
Mar 12 09:56:25 gardnet kernel: Limiting open port RST response from 210 to 200 packets/sec
Mar 12 09:56:28 gardnet kernel: Limiting open port RST response from 210 to 200 packets/sec
Mar 12 09:56:32 gardnet kernel: Limiting open port RST response from 211 to 200 packets/sec
Mar 12 09:56:42 gardnet kernel: Limiting open port RST response from 210 to 200 packets/sec
Mar 12 14:39:20 gardnet sshd[25237]: fatal: Read from socket failed: Connection reset by peer

2

Re: WARNING: failed to start nginx

а если потом вручную запустить?
Возможно, что не запускается, потому что еще не получен ip по dhcp. Но это надо проверять в этом дело или нет.

3 (14-03-2012 06:35:57 отредактировано phpfox)

Re: WARNING: failed to start nginx

crash пишет:

а если потом вручную запустить?
Возможно, что не запускается, потому что еще не получен ip по dhcp. Но это надо проверять в этом дело или нет.

Совершенно верно перед данной проблемой мы меняли провайдера и соответственно меняли настройки но не я а другой человек, может вы мне подскажите какие мне предоставить данные чтоб вы мне смогли чем то помочь а то без автоматического запуска nginx не могу, так как бывают перебои с электроэнергией и человек который может запустить сервер не умеет пользоваться консолем  только и может это нажать на кнопку запуска.

4

Re: WARNING: failed to start nginx

думаю, что надо поиграться скриптом запуска.
В плане этого

# PROVIDE: 
# REQUIRE: 
# BEFORE: 
# KEYWORD: 

почитайте man rc, может натолкнет на мысль.

5

Re: WARNING: failed to start nginx

Скрипт запуска nginx видимо лежит в /etc/rc.d или /etc/rc ? *(исходя из ошибки).
Перенесите его в /usr/local/etc/rc.d

6

Re: WARNING: failed to start nginx

Данный скрипт НЕ лежит в /etc/rc.d он лежит в /usr/local/etc/rc.d собственно вот он сам может в нем проблема.

 
#!/bin/sh
# $FreeBSD: ports/www/nginx-devel/files/nginx.sh.in,v 1.12 2012/01/14 08:57:15 dougb Exp $
# PROVIDE: nginx
# REQUIRE: LOGIN cleanvar
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable nginx:
# nginx_enable (bool):        Set to "NO" by default.
#                Set it to "YES" to enable nginx
# nginx_profiles (str):        Set to "" by default.
#                Define your profiles here.
# nginxlimits_enable (bool):    Set to "NO" by default.
#                Set it to yes to run `limits $limits_args`
#                just before nginx starts.
# nginx_flags (str):        Set to "" by default.
#                Extra flags passed to start command.
# nginxlimits_args (str):    Default to "-e -U www"
#                Arguments of pre-start limits run.
. /etc/rc.subr
name="nginx"
rcvar=nginx_enable
start_precmd="nginx_precmd"
restart_precmd="nginx_checkconfig"
reload_precmd="nginx_checkconfig"
configtest_cmd="nginx_checkconfig"
gracefulstop_cmd="nginx_gracefulstop"
upgrade_precmd="nginx_checkconfig"
upgrade_cmd="nginx_upgrade"
command="/usr/local/sbin/nginx"
_pidprefix="/var/run/nginx"
pidfile="${_pidprefix}.pid"
required_files=/usr/local/etc/nginx/nginx.conf
[ -z "$nginx_enable" ]        && nginx_enable="NO"
[ -z "$nginxlimits_enable" ]    && nginxlimits_enable="NO"
[ -z "$nginxlimits_args" ]    && nginxlimits_args="-e -U www"
load_rc_config $name
if [ -n "$2" ]; then
    profile="$2"
    if [ "x${nginx_profiles}" != "x" ]; then
        pidfile="${_pidprefix}.${profile}.pid"
        eval nginx_configfile="\${nginx_${profile}_configfile:-}"
        if [ "x${nginx_configfile}" = "x" ]; then
            echo "You must define a configuration file (nginx_${profile}_configfile)"
            exit 1
        fi
        required_files="${nginx_configfile}"
        eval nginx_enable="\${nginx_${profile}_enable:-${nginx_enable}}"
        eval nginx_flags="\${nginx_${profile}_flags:-${nginx_flags}}"
        eval nginxlimits_enable="\${nginxlimits_${profile}_enable:-${nginxlimits_enable}}"
        eval nginxlimits_args="\${nginxlimits_${profile}_args:-${nginxlimits_args}}"
        nginx_flags="-c ${nginx_configfile} -g \"pid ${pidfile};\" ${nginx_flags}"
    else
        echo "$0: extra argument ignored"
    fi
else
    if [ "x${nginx_profiles}" != "x" -a "x$1" != "x" ]; then
        for profile in ${nginx_profiles}; do
            echo "===> nginx profile: ${profile}"
            /usr/local/etc/rc.d/nginx $1 ${profile}
            retcode="$?"
            if [ "0${retcode}" -ne 0 ]; then
                failed="${profile} (${retcode}) ${failed:-}"
            else
                success="${profile} ${success:-}"
            fi
        done
        exit 0
    fi
fi
nginx_checkconfig()
{
    echo "Performing sanity check on nginx configuration:"
    eval ${command} ${nginx_flags} -t
}
nginx_gracefulstop()
{
    echo "Performing a graceful stop:"
    sig_stop="QUIT"
    run_rc_command ${rc_prefix}stop $rc_extra_args || return 1
}
nginx_upgrade()
{
    echo "Upgrading nginx binary:"
    reload_precmd=""
    sig_reload="USR2"
    run_rc_command ${rc_prefix}reload $rc_extra_args || return 1
    sleep 1
    echo "Stopping old binary:"
    sig_reload="QUIT"
    pidfile="$pidfile.oldbin"
    run_rc_command ${rc_prefix}reload $rc_extra_args || return 1
}
nginx_precmd() 
{
    nginx_checkconfig
    if checkyesno nginxlimits_enable
    then
        eval `/usr/bin/limits ${nginxlimits_args}` 2>/dev/null
    else
        return 0
    fi
}
extra_commands="reload configtest upgrade gracefulstop"
run_rc_command "$1"

7

Re: WARNING: failed to start nginx

Как вариант в /etc/rc.d/dhclient указать

# BEFORE: nginx

Сам не проверял, но в роде из доки получается так. Проверить не на чем

8

Re: WARNING: failed to start nginx

crash пишет:

Как вариант в /etc/rc.d/dhclient указать

# BEFORE: nginx

Сам не проверял, но в роде из доки получается так. Проверить не на чем

Если точнее то вот так должно выглядить? или нужно соблюдать очередность?

#!/bin/sh
#
# $FreeBSD: src/etc/rc.d/dhclient,v 1.32.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $
#
# PROVIDE: dhclient
# KEYWORD: nojail nostart
# BEFORE: nginx
. /etc/rc.subr
. /etc/network.subr
name="dhclient"
rcvar=
start_cmd="dhclient_start"
stop_cmd="dhclient_stop"
dhclient_start()
{
    # prevent unnecessary restarts
    # XXX: dhclient had better create a pidfile
    if [ -x /bin/pgrep ]; then
        pids=`/bin/pgrep -f "dhclient: $ifn(\$| .*)"`
        if [ -n "$pids" ]; then
            sleep 1
            pids=`/bin/pgrep -f "dhclient: $ifn(\$| .*)"`
            if [ -n "$pids" ]; then
                exit 0
            fi
        elif [ -e /var/run/dhclient.pid ]; then
            if [ -n "`pgrep -F /var/run/dhclient.pid`" ]; then
                exit 0
            fi
        fi
    fi
    # Override for $ifn specific flags (see rc.subr for $flags setting)
    specific=`get_if_var $ifn dhclient_flags_IF`
    if [ -z "$flags" -a -n "$specific" ]; then
        rc_flags=$specific
    fi
    background_dhclient=`get_if_var $ifn background_dhclient_IF $background_dhclient`
    if checkyesno background_dhclient; then
        rc_flags="${rc_flags} -b"
    fi
    ${dhclient_program} ${rc_flags} $ifn
}
dhclient_stop()
{
    ifconfig $ifn down    # cause dhclient to die
}
ifn="$2"
load_rc_config $name
load_rc_config network
if ! dhcpif $ifn; then
    return 1
fi
run_rc_command "$1"

9

Re: WARNING: failed to start nginx

думаю, что очередность не принципиально. Но вы можете перегрузить сервак и проверить

10

Re: WARNING: failed to start nginx

Не к сожалению не помогло, даже менял место положение все без результатно, может я малость гоню, как мне известно

# BEFORE: nginx то данная функция щас закоментирована может нужно разкоментировать? или еще какие нибудь есть предложения.

11

Re: WARNING: failed to start nginx

зачем на сервере dhcp? У вас что, динамичиский адресс?