![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| SuSE SUSE Linux is a major operating system. The developer rights are owned by Novell, Inc. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Start Asterisk at boot? | hast5 | SuSE | 4 | 12-21-2006 02:17 PM |
| vsftpd won't start on SLES 10 | dave521 | SuSE | 5 | 09-22-2006 11:10 AM |
| SUN SOLARIS boot: start daemons | ctap | SUN Solaris | 1 | 07-14-2005 08:07 AM |
| nfsd won't start at boot up | dcshungu | SUN Solaris | 19 | 03-13-2005 11:30 PM |
| start a process at boot up time | vtran4270 | UNIX for Advanced & Expert Users | 1 | 12-08-2002 07:31 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
These are the two apachectl files, please advise on how to start web and ftp to start automatically.
/usr/local/apache2/bin/apachectl /opt/httpd-2.2.9/support/apachectl # When multiple arguments are given, only the error from the _last_ # one is reported. Run "apachectl help" for usage info # ARGV="$@" # # |||||||||||||||||||| START CONFIGURATION SECTION |||||||||||||||||||| # -------------------- -------------------- # # the path to your httpd binary, including options if necessary HTTPD='/usr/local/apache2/bin/httpd' # # pick up any necessary environment variables if test -f /usr/local/apache2/bin/envvars; then . /usr/local/apache2/bin/envvars fi # # a command that outputs a formatted text version of the HTML at the # url given on the command line. Designed for lynx, however other # programs may work. LYNX="lynx -dump" # # the URL to your server's mod_status status page. If you do not # have one, then status and fullstatus will not work. STATUSURL="http://localhost:80/server-status" # # Set this variable to a command that increases the maximum # number of file descriptors allowed per child process. This is # critical for configurations that use many file descriptors, # such as mass vhosting, or a multithreaded server. ULIMIT_MAX_FILES="ulimit -S -n `ulimit -H -n`" # -------------------- -------------------- # |||||||||||||||||||| END CONFIGURATION SECTION |||||||||||||||||||| # Set the maximum number of file descriptors allowed per child process. if [ "x$ULIMIT_MAX_FILES" != "x" ] ; then $ULIMIT_MAX_FILES fi ERROR=0 if [ "x$ARGV" = "x" ] ; then ARGV="-h" fi case $ARGV in start|stop|restart|graceful|graceful-stop) $HTTPD -k $ARGV ERROR=$? ;; startssl|sslstart|start-SSL) echo The startssl option is no longer supported. echo Please edit httpd.conf to include the SSL configuration settings echo and then use "apachectl start". ERROR=2 ;; configtest) $HTTPD -t ERROR=$? ;; status) $LYNX $STATUSURL | awk ' /process$/ { print; exit } { print } ' ;; fullstatus) $LYNX $STATUSURL ;; *) $HTTPD $ARGV ERROR=$? esac exit $ERROR |
|
||||
|
s01:~ # ps -aux
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.5 0.0 772 324 ? Ss 19:18 0:01 init [5] root 2 0.0 0.0 0 0 ? S< 19:18 0:00 [kthreadd] root 3 0.0 0.0 0 0 ? S< 19:18 0:00 [migration/0] root 4 0.0 0.0 0 0 ? S< 19:18 0:00 [ksoftirqd/0] root 5 0.0 0.0 0 0 ? S< 19:18 0:00 [events/0] root 6 0.0 0.0 0 0 ? S< 19:18 0:00 [khelper] root 7 0.0 0.0 0 0 ? S< 19:18 0:00 [kblockd/0] root 8 0.0 0.0 0 0 ? S< 19:18 0:00 [kacpid] root 9 0.0 0.0 0 0 ? S< 19:18 0:00 [kacpi_notify] root 10 0.0 0.0 0 0 ? S< 19:18 0:00 [cqueue] root 11 0.0 0.0 0 0 ? S< 19:18 0:00 [kseriod] root 12 0.0 0.0 0 0 ? S< 19:18 0:00 [kondemand/0] root 13 0.0 0.0 0 0 ? S 19:18 0:00 [pdflush] root 14 0.0 0.0 0 0 ? S 19:18 0:00 [pdflush] root 15 0.0 0.0 0 0 ? S< 19:18 0:00 [kswapd0] root 16 0.0 0.0 0 0 ? S< 19:18 0:00 [aio/0] root 17 0.0 0.0 0 0 ? S< 19:18 0:00 [kpsmoused] root 59 0.0 0.0 0 0 ? S< 19:18 0:00 [scsi_eh_0] root 63 0.0 0.0 0 0 ? S< 19:18 0:00 [ata/0] root 64 0.0 0.0 0 0 ? S< 19:18 0:00 [ata_aux] root 70 0.0 0.0 0 0 ? S< 19:18 0:00 [scsi_eh_1] root 71 0.0 0.0 0 0 ? S< 19:18 0:00 [scsi_eh_2] root 195 0.0 0.0 0 0 ? S< 19:18 0:00 [ksuspend_usbd] root 198 0.0 0.0 0 0 ? S< 19:18 0:00 [khubd] root 503 0.0 0.0 0 0 ? S< 19:18 0:00 [kjournald] root 567 0.1 0.2 2520 1192 ? S<s 19:18 0:00 /sbin/udevd --d root 1135 0.0 0.0 0 0 ? S< 19:18 0:00 [kauditd] root 1148 0.0 0.0 0 0 ? S< 19:18 0:00 [kstriped] root 1182 0.0 0.0 0 0 ? S< 19:18 0:00 [kjournald] root 1526 0.0 0.1 1664 584 ? Ss 19:18 0:00 /sbin/acpid root 1532 0.0 0.1 1916 668 ? Ss 19:18 0:00 /sbin/resmgrd root 1538 0.0 0.1 1800 596 ? Ss 19:18 0:00 /sbin/klogd -c 102 1542 0.0 0.1 2280 740 ? Ss 19:18 0:00 /bin/dbus-daemo root 1545 0.0 0.1 2200 732 ? Ss 19:18 0:00 /sbin/syslog-ng root 1570 0.0 0.4 7752 2200 ? Ssl 19:18 0:00 /usr/sbin/conso 105 1679 0.1 0.7 6172 4024 ? Ss 19:18 0:00 /usr/sbin/hald root 1680 0.0 0.2 3220 1080 ? S 19:18 0:00 hald-runner root 1692 0.0 0.2 3332 1080 ? S 19:18 0:00 hald-addon-inpu 105 1695 0.0 0.1 2204 948 ? S 19:18 0:00 hald-addon-acpi root 1701 0.0 0.2 3336 1084 ? S 19:18 0:00 hald-addon-stor root 1708 0.0 0.2 3336 1080 ? S 19:18 0:00 hald-addon-stor root 1811 0.0 0.4 13564 2276 ? Ss 19:18 0:00 /usr/sbin/gdm root 1812 0.0 0.5 14192 2828 ? S 19:18 0:00 /usr/sbin/gdm root 1827 0.2 1.6 14292 8492 tty7 Ss+ 19:18 0:00 /usr/bin/X :0 - bin 2216 0.0 0.0 1696 444 ? Ss 19:18 0:00 /sbin/portmap root 2283 0.0 0.1 10248 712 ? S<sl 19:18 0:00 /sbin/auditd -s root 2290 0.0 0.1 10004 724 ? S<sl 19:18 0:00 /sbin/audispd gdm 2451 1.2 3.2 26100 16928 ? Ss 19:18 0:02 /usr/lib/gdm/gd avahi 2580 0.0 0.3 2872 1548 ? Ss 19:18 0:00 avahi-daemon: r root 2592 0.0 0.1 1824 580 ? Ss 19:18 0:00 /usr/sbin/avahi root 2627 0.0 0.4 7252 2416 ? Ss 19:18 0:00 /usr/sbin/cupsd root 2629 0.0 0.2 141508 1064 ? Ssl 19:18 0:00 /usr/sbin/nscd root 2682 0.0 0.3 4600 1744 ? S 19:18 0:00 /usr/sbin/power root 2734 0.0 0.2 6328 1168 ? Ss 19:18 0:00 /usr/sbin/sshd root 2756 0.0 0.3 6552 1768 ? Ss 19:18 0:00 /usr/lib/postfi postfix 2777 0.0 0.3 6352 1696 ? S 19:18 0:00 pickup -l -t fi postfix 2778 0.0 0.3 6396 1732 ? S 19:18 0:00 qmgr -l -t fifo root 2825 0.0 0.1 2060 620 ? Ss 19:18 0:00 /usr/sbin/cron root 2838 0.1 0.5 8932 3060 ? Ss 19:18 0:00 /usr/sbin/httpd apache 2841 0.0 0.3 8704 1708 ? S 19:18 0:00 /usr/sbin/httpd apache 2849 0.0 0.4 230280 2268 ? Sl 19:18 0:00 /usr/sbin/httpd apache 2853 0.0 0.4 230280 2272 ? Sl 19:18 0:00 /usr/sbin/httpd apache 2858 0.0 0.4 230280 2272 ? Sl 19:18 0:00 /usr/sbin/httpd root 2933 0.0 0.1 3772 940 ? S 19:18 0:00 /usr/sbin/vsftp root 2937 0.0 0.1 3144 608 ? S 19:18 0:00 /usr/sbin/smart root 2956 0.0 0.1 2152 656 tty1 Ss+ 19:18 0:00 /sbin/mingetty root 2958 0.0 0.1 2152 652 tty2 Ss+ 19:18 0:00 /sbin/mingetty root 2960 0.0 0.1 2152 624 tty3 Ss+ 19:18 0:00 /sbin/mingetty root 2964 0.0 0.1 2152 628 tty4 Ss+ 19:18 0:00 /sbin/mingetty root 2966 0.0 0.1 2152 628 tty5 Ss+ 19:18 0:00 /sbin/mingetty root 2968 0.0 0.1 2152 628 tty6 Ss+ 19:18 0:00 /sbin/mingetty root 2998 0.0 0.5 9772 2840 ? Ss 19:19 0:00 sshd: root@pts/ root 3004 0.0 0.4 4720 2244 pts/0 Ss 19:19 0:00 -bash root 3044 0.0 0.1 2580 872 pts/0 R+ 19:21 0:00 ps -aux s01:~ # ls -al /etc/rc2.d ls: cannot access /etc/rc2.d: No such file or directory s01:~ # ls -al /etc/init.d total 700 drwxr-xr-x 11 root root 4096 Sep 16 18:43 . drwxr-xr-x 109 root root 12288 Sep 17 19:18 .. -rw-r--r-- 1 root root 1605 Sep 17 19:16 .depend.boot -rw-r--r-- 1 root root 3329 Sep 17 19:16 .depend.start -rw-r--r-- 1 root root 2360 Sep 17 19:16 .depend.stop -rw-r--r-- 1 root root 7827 Jun 6 23:00 README -rwxr-xr-x 1 root root 1223 Jun 6 22:58 SuSEfirewall2_init -rwxr-xr-x 1 root root 1563 Jun 6 22:58 SuSEfirewall2_setup -rwxr-xr-x 1 root root 3409 Jun 7 05:29 aaeventd -rwxr--r-- 1 root root 3734 Jun 6 23:11 acpid -rwxr-xr-x 1 root root 5311 Jun 7 00:29 alsasound -rwxr--r-- 1 root root 10132 Jun 7 02:54 apache2 -rwxr-xr-x 1 root root 3955 Jun 7 00:21 atd -rwxr-xr-x 1 root root 6725 Jun 6 22:45 auditd -rwxr-xr-x 1 root root 4816 Jun 7 02:06 autofs -rwxr-xr-x 1 root root 2967 May 21 2007 autoyast -rwxr-xr-x 1 root root 1410 Jun 7 04:19 avahi-daemon -rwxr-xr-x 1 root root 1337 Jun 7 04:19 avahi-dnsconfd -rwxr-xr-x 1 root root 4438 Jun 7 06:59 bluetooth -rwxr-xr-x 1 root root 7373 Mar 18 2008 boot -rwxr-xr-x 1 root root 2843 Jun 7 05:29 boot.apparmor -rwxr-xr-x 1 root root 1222 Jun 7 01:22 boot.blktrace -rwxr-xr-x 1 root root 2943 May 7 16:40 boot.cleanup -rwxr-xr-x 1 root root 3349 May 20 10:32 boot.clock -rwxr-xr-x 1 root root 2427 Jun 6 23:46 boot.crypto -rwxr-xr-x 1 root root 2327 Jun 6 23:46 boot.crypto-early -rwxr-xr-x 1 root root 1995 Jun 6 23:22 boot.cycle drwxr-xr-x 2 root root 4096 Sep 10 19:09 boot.d -rwxr-xr-- 1 root root 3492 Jun 8 15:19 boot.dazuko -rwxr--r-- 1 root root 778 Jun 6 22:46 boot.device-mapper -rwxr--r-- 1 root root 1228 Jun 6 23:06 boot.dmraid -rwxr-xr-x 1 root root 1590 Jun 7 00:17 boot.fuse -rwxr-xr-x 1 root root 1180 Apr 18 14:54 boot.getclock -rwxr-xr-x 1 root root 3427 May 7 16:40 boot.ipconfig -rwxr-xr-x 1 root root 1723 Jun 20 2007 boot.klog -rwxr-xr-x 1 root root 1681 Aug 11 2007 boot.ldconfig -rwxr-xr-x 1 root root 1003 Jun 20 2007 boot.loadmodules -rwxr--r-- 1 root root 395 Jun 10 15:18 boot.local -rwxr-xr-x 1 root root 8057 Jun 4 20:21 boot.localfs -rwxr-xr-x 1 root root 1583 Oct 16 2007 boot.localnet -rwxr-xr-x 1 root root 1370 Jun 6 23:30 boot.lvm -rwxr-xr-x 1 root root 5476 Jun 7 00:22 boot.md -rwxr-xr-x 1 root root 1631 Sep 14 2007 boot.proc -rwxr-xr-x 1 root root 4935 Apr 7 12:19 boot.rootfsck -rwxr-xr-x 1 root root 1955 Jun 20 2007 boot.sched -rwxr-xr-x 1 root root 1517 Jun 7 02:32 boot.scpm -rwxr-xr-x 1 root root 2901 May 9 15:25 boot.swap -rwxr-xr-x 1 root root 1040 Jun 6 22:47 boot.sysctl -rwxr-xr-x 1 root root 2073 Jun 6 22:46 boot.udev -rwxr-xr-x 1 root root 763 Jun 6 22:46 boot.udev_retry -rwxr--r-- 1 root root 5483 Jul 11 03:22 clamav-milter -rwxr--r-- 1 root root 8951 Jul 11 03:22 clamd -rwxr-xr-x 1 root root 1440 Jun 7 03:28 consolekit -rwxr--r-- 1 root root 4294 Jun 7 00:21 cron -rwxr-xr-x 1 root root 4858 Jun 7 01:51 cups -rwxr-xr-x 1 root root 3153 Jun 7 00:27 dbus -rwxr-xr-- 1 root root 1776 Jun 6 22:44 earlysyslog -rwxr-xr-x 1 root root 2921 Jun 7 01:22 earlyxdm -rwxr-xr-x 1 root root 5402 Jun 7 00:02 fbset -rwxr-xr-x 1 root root 3291 Jun 6 23:20 festival -rwxr--r-- 1 root root 8940 Jul 11 03:22 freshclam -rwxr-xr-x 1 root root 4310 Jun 6 23:07 gpm -rwxr-xr-x 1 root root 6416 Jun 7 03:39 haldaemon -rwxr-xr-x 1 root root 6053 May 9 00:23 halt -rwxr--r-- 1 root root 360 Jun 10 15:18 halt.local -rwxr-xr-x 1 root root 9851 Jun 7 01:20 java.binfmt_misc -rwxr-xr-x 1 root root 2911 Jun 7 00:29 joystick -rwxr-xr-x 1 root root 13462 Jun 7 00:01 kbd -rwxr-xr-x 1 root root 7274 Jun 7 02:18 lirc -rwxr-xr-x 1 root root 3077 Jun 7 03:22 lm_sensors -rwxr-xr-x 1 root root 3990 Jun 7 00:22 mdadmd -rwxr-xr-x 1 root root 1155 Jun 6 23:11 microcode.ctl -rwxr-xr-x 1 root root 23733 Jun 6 23:15 network -rwxr--r-- 1 root root 6056 Jun 7 01:57 nfs -rwxr-xr-- 1 root root 2653 Nov 13 2007 nmb -rwxr-xr-x 1 root root 3252 Jun 6 21:56 nscd -rwxr-xr-x 1 root root 5931 Jun 7 02:00 ntp -rwxr-xr-x 1 root root 2047 Jun 7 04:06 openct -rwxr-xr-x 1 root root 1588 Jun 7 03:50 pcscd -rwxr--r-- 1 root root 3667 Jun 6 23:08 portmap -rwxr-xr-x 1 root root 5295 Jun 7 02:32 postfix -rwxr--r-- 1 root root 1335 Jun 6 22:57 powerd -rwxr-xr-x 1 root root 2390 Sep 1 2003 powerfail -rwxr-xr-x 1 root root 7496 Jun 7 03:33 powersaved -rwxr-xr-x 1 root root 1773 May 7 16:40 random -rwxr--r-- 1 root root 1241 Jun 7 00:22 raw -rwxr-xr-x 1 root root 9361 Mar 18 2008 rc drwxr-xr-x 2 root root 4096 Jun 10 15:25 rc0.d drwxr-xr-x 2 root root 4096 Jun 10 15:27 rc1.d drwxr-xr-x 2 root root 4096 Sep 12 17:45 rc2.d drwxr-xr-x 2 root root 4096 Sep 17 19:15 rc3.d drwxr-xr-x 2 root root 4096 Sep 11 17:31 rc4.d drwxr-xr-x 2 root root 4096 Sep 17 19:15 rc5.d drwxr-xr-x 2 root root 4096 Jun 10 15:25 rc6.d drwxr-xr-x 2 root root 4096 Jun 10 15:27 rcS.d lrwxrwxrwx 1 root root 4 Sep 10 18:58 reboot -> halt -rwxr-xr-x 1 root root 3861 Jun 7 00:38 resmgr -rwxr-xr-x 1 root root 3771 Jun 7 01:50 rpasswdd -rwxr-xr-x 1 root root 2486 Jun 6 21:35 rpmconfigcheck -rwxr-xr-x 1 root root 3867 Jun 7 05:08 rsyncd -rwxr-xr-x 1 root root 4056 Jun 7 02:33 saslauthd -rwxr-xr-x 1 root root 9584 Jun 6 22:48 setserial -rwxr-xr-x 1 root root 1180 Sep 1 2003 single -rwxr-xr-x 1 root root 10640 Jun 20 2007 skeleton -rwxr-xr-x 1 root root 12733 Jan 11 2008 skeleton.compat -rwxr-xr-x 1 root root 15087 Jun 7 00:18 smartd -rwxr-xr-- 1 root root 2804 Nov 13 2007 smb -rwxr-xr-- 1 root root 5163 Nov 13 2007 smbfs -rwxr-xr-x 1 root root 3042 Jun 7 00:20 splash -rwxr-xr-x 1 root root 490 Jun 7 00:20 splash_early -rwxr-xr-x 1 root root 3878 Aug 21 2007 sshd -rwxr-xr-x 1 root root 1006 Jun 7 01:22 stopblktrace -rwxr-xr-- 1 root root 4336 Jun 6 22:44 syslog -rwxr--r-- 1 root root 1818 Jun 6 23:09 uuidd -rwxr-xr-x 1 root root 2975 Jun 16 15:28 vsftpd -rwxr-xr-x 1 root root 1020 Jun 7 01:22 waitfornm -rwxr-xr-x 1 root root 6835 Jun 7 02:22 xdm -rwxr-xr-x 1 root root 2092 Sep 11 2006 xfs -rwxr-xr-x 1 root root 4315 Jun 6 23:07 xinetd -rwxr-xr-x 1 root root 5331 Jun 7 03:33 ypbind |
|
||||
|
OpenSuse 11.0
s01:~ # cat /etc/init.d/apache2 #!/bin/sh # # Copyright (c) 1996, 1997, 1998 S.u.S.E. GmbH # Copyright (c) 1998, 1999, 2000, 2001 SuSE GmbH # Copyright (c) 2002, 2003, (2004?) SuSE Linux AG # Copyright (c) 2004(?), 2005, 2006, 2007 SUSE Linux Products GmbH # # Authors: Rolf Haberrecker <apache@suse.de>, 2001 # Peter Poeml <apache@suse.de>, 2002, 2003, 2004, 2005, 2006, 2007 # # # /etc/init.d/apache2 # ### BEGIN INIT INFO # Provides: apache2 httpd2 # Required-Start: $local_fs $remote_fs $network # Should-Start: $named $time postgresql sendmail mysql ypclient dhcp radiusd # Required-Stop: $local_fs $remote_fs $network # X-UnitedLinux-Should-Stop: # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Short-Description: Apache 2.2 httpd # Description: Start the httpd daemon Apache ### END INIT INFO pname=apache2 : ${sysconfdir:=/etc/$pname} : ${apache_link:=/usr/sbin/httpd2} : ${sysconfig_apache:=/etc/sysconfig/$pname} : ${pidfile:=/var/run/httpd2.pid} : ${logdir:=/var/log/$pname} : ${homedir:=/var/lib/$pname} # # load the configuration # test -s /etc/rc.status && . /etc/rc.status && rc_reset . /usr/share/$pname/load_configuration export ${!APACHE_*} httpd_conf=${APACHE_HTTPD_CONF:-$sysconfdir/httpd.conf} apache_bin=$(/usr/share/$pname/find_mpm 2>/dev/null) test -L $apache_link && apache_bin=$(readlink $apache_link) if [ -z "$APACHE_MPM" ]; then APACHE_MPM=${apache_bin##*-} fi if ! [ -x $apache_bin ]; then echo >&2 ${warn}$apache_bin-$APACHE_MPM is not a valid httpd2 binary. echo >&2 Check your APACHE_MPM setting in /etc/sysconfig/$pname. $norm rc_failed 5 rc_status -v1 rc_exit fi # a proper home should be set, otherwise the server might end up # with HOME=/root and some script might try to use that HOME=$homedir get_server_flags() { unset server_flags case "$action" in startssl) server_flags="-DSSL";; esac for i in $APACHE_SERVER_FLAGS; do case $i in -D) ;; -D*) server_flags="$server_flags $i";; *) server_flags="$server_flags -D$i";; esac done } action="$1" case "$action" in stop|try-restart|*status*|probe) ;; *) shift; get_server_flags ${get_module_list_done:=false} || /usr/share/$pname/get_module_list && export get_module_list_done=true ${get_includes:=false} || /usr/share/$pname/get_includes && export get_includes_done=true ;; esac # # main part # case "$action" in start*) if [ -e $pidfile ]; then $0 status &>/dev/null ret=$? if [ $ret = 1 ]; then echo "Warning: found stale pidfile (unclean shutdown?)" elif [ $ret = 0 ]; then echo "Apache is already running ($pidfile)" rc_failed $ret rc_status -v1 rc_exit fi fi echo -n "Starting httpd2 (${APACHE_MPM:-${apache_bin#*-}}) " cmdline=$(echo $apache_bin -f $httpd_conf $server_flags "$@") if eval $cmdline -t > $logdir/rc$pname.out 2>&1 ; then export -n ${!APACHE_*} eval startproc -f -t ${APACHE_START_TIMEOUT:-2} $cmdline ret=$? if test -t 1 && stty -a 2>/dev/null | grep -q -- -echo\ ; then # this means that apache was still waiting for a passphrase to be entered stty echo 2>/dev/null echo;echo echo >&2 An SSL passphrase has not been entered within ${APACHE_START_TIMEOUT:-<not set>} seconds. echo >&2 To increase this timeout, adjust APACHE_START_TIMEOUT in $sysconfig_apache . # this surely means that apache won't start, despite it looked good to startproc killall $apache_bin echo >&2 "Trying to start the server without SSL (-D NOSSL)." $0 start "$@" -D NOSSL # rc_failed 1 # rc_status -v1 # rc_exit else rc_failed $ret rc_status -v fi else if [ "$link" = "$base" ] ; then cat $logdir/rc$pname.out echo >&2 echo >&2 The command line was: echo >&2 $cmdline echo >&2 else echo -e -n "\nsee $logdir/rc$pname.out for details\n"; fi rc_failed 1 rc_status -v1 fi ;; stop) echo -n "Shutting down httpd2 " if [ ! -f $pidfile -a -f $pidfile.rpmsave ]; then mv $pidfile.rpmsave $pidfile; fi if ! [ -f $pidfile ]; then echo -n "(not running)" else pid=$(<$pidfile) kill -TERM $pid 2>/dev/null case $? in 1) echo -n "(not running)";; 0) # wait until the processes are gone (the parent is the last one) echo -n "(waiting for all children to terminate) " for ((wait=0; wait<120; wait++)); do if test -f $pidfile; then usleep 500000 continue fi if ! test -f /proc/$pid/exe; then break fi if test "$(readlink /proc/$pid/exe 2>/dev/null)" = $apache_bin; then usleep 500000 else break fi done ;; esac fi rc_status -v ;; stop-graceful) echo "Shutting down httpd2 gracefully (SIGWINCH)" if ! [ -f $pidfile ]; then echo -n "(not running)" else pid=$(<$pidfile) kill -WINCH $pid 2>/dev/null case $? in 1) echo -n "(not running)";; 0) # wait until the pidfile is gone. The parent stays there, but closes the listen ports. echo -n "(waiting for parent to close listen ports and remove pidfile) " for ((wait=0; wait<120; wait++)); do if test -f $pidfile; then usleep 500000 continue else break fi done ;; esac fi rc_status -v ;; try-restart) ## Do a restart only if the service was active before. ## Note: try-restart is now part of LSB (as of 1.9). ## RH has a similar command named condrestart. $0 status if test $? = 0; then $0 restart else rc_reset # Not running is not a failure. fi # Remember status and be quiet rc_status ;; restart) $0 configtest "$@" || { rc_failed $?; rc_exit; } if $0 status &>/dev/null; then $0 stop fi $0 start "$@" # Remember status and be quiet rc_status ;; restart-hup) $0 configtest "$@" || { rc_failed $?; rc_exit; } if $0 status &>/dev/null; then echo -n "Restarting httpd2 (SIGHUP)" kill -HUP $(<$pidfile) || return=$rc_failed else $0 start "$@" fi # Remember status and be quiet rc_status -v ;; restart-graceful) $0 configtest "$@" || { rc_failed $?; rc_exit; } if $0 status &>/dev/null; then $0 stop-graceful "$@" $0 start "$@" else $0 start "$@" fi # Remember status and be quiet rc_status ;; reload|force-reload|graceful) echo -n "Reload httpd2 (graceful restart)" cmdline=$(echo $apache_bin -f $httpd_conf $server_flags "$@") if eval $cmdline -t &> $logdir/rc$pname.out; then killproc -USR1 $apache_bin || return=$rc_failed rc_status -v else if [ "$link" = "$base" ] ; then echo -e -n "\n\n" cat $logdir/rc$pname.out echo >&2 echo >&2 The command line was: echo >&2 $cmdline echo >&2 else echo -e -n "\nsee $logdir/rc$pname.out for details\n"; fi rc_failed 6 rc_status -v1 fi ;; status) if [ ! -f $pidfile -a -f $pidfile.rpmsave ]; then mv $pidfile.rpmsave $pidfile; fi echo -n "Checking for httpd2: " # we don't use checkproc here since it is confused when we exchange the binaries if ! [ -f $pidfile ]; then # not running rc_failed 3 elif [ -s $pidfile -a -d /proc/$(<$pidfile) ]; then # running : else # stale pid file rc_failed 1 #rm -f $pidfile fi rc_status -v ;; probe) ## Optional: Probe for the necessity of a reload, ## give out the argument which is required for a reload. for i in $httpd_conf \ $APACHE_CONF_INCLUDE_FILES \ $APACHE_CONF_INCLUDE_DIRS do if [ $i -nt $pidfile ]; then echo reload break fi done ;; conf*|test|syntax|check) cmdline=$(echo $apache_bin -f $httpd_conf $server_flags "$@") eval $cmdline -t rc_failed $? rc_exit ;; extr*) cmdline=$(echo $apache_bin -f $httpd_conf $server_flags "$@") out=$(su - nobody -c "$cmdline" 2>&1) case $out in *make_sock:\ could\ not\ bind\ to\ address*) echo Syntax: OK; rc_failed=0;; *) echo Syntax: NOT OK:; echo $out; rc_failed=1;; esac rc_exit ;; server-status) apache2ctl status ;; full-server-status|fullstatus) apache2ctl fullstatus ;; *) cat >&2 <<-EOF Usage: $0 <command> <server flags> where <command> is one of: start - start httpd startssl - start httpd with -DSSL stop - stop httpd (sending SIGTERM to parent) try-restart - stop httpd and if this succeeds (i.e. if it was running before), start it again. status - check whether httpd is running restart - stop httpd if running; start httpd restart-graceful - stop httpd gracefully if running; start httpd reload|graceful - do a graceful restart by sending a SIGUSR1, or start if not running stop-graceful - stop httpd (sending SIGWINCH to parent) configtest - do a configuration syntax test extreme-configtest - try to run httpd as nobody (detects more errors by actually loading the configuration, but cannot read SSL certificates) probe - probe for the necessity of a reload, give out the argument which is required for a reload. (by comparing conf files with pidfile timestamp) full-server-status - dump a full status screen; requires lynx or w3m and mod_status enabled server-status - dump a short status screen; requires lynx or w3m and mod_status enabled help - this screen optional server flags are passed through to httpd. EOF exit 1 esac # Inform the caller not only verbosely and set an exit status. rc_exit ================================================================== s01:~ # ls -al /etc/init.d/rc2.d total 8 drwxr-xr-x 2 root root 4096 Sep 12 17:45 . drwxr-xr-x 11 root root 4096 Sep 17 19:30 .. lrwxrwxrwx 1 root root 15 Sep 10 18:59 K01stopblktrace -> ../stopblktrace lrwxrwxrwx 1 root root 7 Sep 12 17:45 K09cron -> ../cron lrwxrwxrwx 1 root root 9 Sep 12 17:45 K09smartd -> ../smartd lrwxrwxrwx 1 root root 12 Sep 10 19:13 K12alsasound -> ../alsasound lrwxrwxrwx 1 root root 7 Sep 10 18:59 K12cups -> ../cups lrwxrwxrwx 1 root root 13 Sep 10 19:04 K12powersaved -> ../powersaved lrwxrwxrwx 1 root root 9 Sep 10 18:59 K12splash -> ../splash lrwxrwxrwx 1 root root 15 Sep 10 18:59 K15splash_early -> ../splash_early lrwxrwxrwx 1 root root 9 Sep 10 18:59 K16syslog -> ../syslog lrwxrwxrwx 1 root root 10 Sep 10 18:59 K17network -> ../network lrwxrwxrwx 1 root root 12 Sep 10 18:59 K19haldaemon -> ../haldaemon lrwxrwxrwx 1 root root 13 Sep 10 18:59 K20consolekit -> ../consolekit lrwxrwxrwx 1 root root 8 Sep 10 18:59 K21acpid -> ../acpid lrwxrwxrwx 1 root root 7 Sep 10 18:59 K21dbus -> ../dbus lrwxrwxrwx 1 root root 8 Sep 10 18:59 K21fbset -> ../fbset lrwxrwxrwx 1 root root 16 Sep 10 18:59 K21microcode.ctl -> ../microcode.ctl lrwxrwxrwx 1 root root 9 Sep 10 18:59 K21random -> ../random lrwxrwxrwx 1 root root 9 Sep 10 18:59 K21resmgr -> ../resmgr lrwxrwxrwx 1 root root 8 Sep 10 18:59 S01acpid -> ../acpid lrwxrwxrwx 1 root root 7 Sep 10 18:59 S01dbus -> ../dbus lrwxrwxrwx 1 root root 8 Sep 10 18:59 S01fbset -> ../fbset lrwxrwxrwx 1 root root 16 Sep 10 18:59 S01microcode.ctl -> ../microcode.ctl lrwxrwxrwx 1 root root 9 Sep 10 18:59 S01random -> ../random lrwxrwxrwx 1 root root 9 Sep 10 18:59 S01resmgr -> ../resmgr lrwxrwxrwx 1 root root 13 Sep 10 18:59 S02consolekit -> ../consolekit lrwxrwxrwx 1 root root 12 Sep 10 18:59 S03haldaemon -> ../haldaemon lrwxrwxrwx 1 root root 10 Sep 10 18:59 S05network -> ../network lrwxrwxrwx 1 root root 9 Sep 10 18:59 S06syslog -> ../syslog lrwxrwxrwx 1 root root 15 Sep 10 18:59 S07splash_early -> ../splash_early lrwxrwxrwx 1 root root 12 Sep 10 19:13 S10alsasound -> ../alsasound lrwxrwxrwx 1 root root 7 Sep 10 18:59 S10cups -> ../cups lrwxrwxrwx 1 root root 6 Sep 10 18:59 S10kbd -> ../kbd lrwxrwxrwx 1 root root 13 Sep 10 19:04 S10powersaved -> ../powersaved lrwxrwxrwx 1 root root 9 Sep 10 18:59 S10splash -> ../splash lrwxrwxrwx 1 root root 7 Sep 12 17:45 S13cron -> ../cron lrwxrwxrwx 1 root root 9 Sep 12 17:45 S13smartd -> ../smartd lrwxrwxrwx 1 root root 15 Sep 10 18:59 S21stopblktrace -> ../stopblktrace s01:~ # ================================================================== s01:~ # ls -al /etc/init.d/rc3.d total 8 drwxr-xr-x 2 root root 4096 Sep 17 19:15 . drwxr-xr-x 11 root root 4096 Sep 17 19:30 .. lrwxrwxrwx 1 root root 15 Sep 10 18:59 K01stopblktrace -> ../stopblktrace lrwxrwxrwx 1 root root 7 Sep 12 17:45 K09cron -> ../cron lrwxrwxrwx 1 root root 9 Sep 12 17:45 K09smartd -> ../smartd lrwxrwxrwx 1 root root 10 Sep 17 19:03 K10apache2 -> ../apache2 lrwxrwxrwx 1 root root 17 Sep 10 18:59 K11avahi-dnsconfd -> ../avahi-dnsconfd lrwxrwxrwx 1 root root 10 Sep 10 18:59 K11postfix -> ../postfix lrwxrwxrwx 1 root root 12 Sep 10 19:13 K12alsasound -> ../alsasound lrwxrwxrwx 1 root root 15 Sep 10 18:59 K12avahi-daemon -> ../avahi-daemon lrwxrwxrwx 1 root root 7 Sep 10 18:59 K12cups -> ../cups lrwxrwxrwx 1 root root 19 Sep 10 19:03 K12java.binfmt_misc -> ../java.binfmt_misc lrwxrwxrwx 1 root root 7 Sep 10 18:59 K12nscd -> ../nscd lrwxrwxrwx 1 root root 13 Sep 10 19:04 K12powersaved -> ../powersaved lrwxrwxrwx 1 root root 9 Sep 10 18:59 K12splash -> ../splash lrwxrwxrwx 1 root root 7 Sep 10 18:59 K12sshd -> ../sshd lrwxrwxrwx 1 root root 9 Sep 17 19:15 K12vsftpd -> ../vsftpd lrwxrwxrwx 1 root root 8 Sep 10 18:59 K14smbfs -> ../smbfs lrwxrwxrwx 1 root root 9 Sep 10 18:59 K15auditd -> ../auditd lrwxrwxrwx 1 root root 10 Sep 10 18:59 K15portmap -> ../portmap lrwxrwxrwx 1 root root 15 Sep 10 18:59 K15splash_early -> ../splash_early lrwxrwxrwx 1 root root 9 Sep 10 18:59 K16syslog -> ../syslog lrwxrwxrwx 1 root root 10 Sep 10 18:59 K17network -> ../network lrwxrwxrwx 1 root root 12 Sep 10 18:59 K19haldaemon -> ../haldaemon lrwxrwxrwx 1 root root 13 Sep 10 18:59 K20consolekit -> ../consolekit lrwxrwxrwx 1 root root 8 Sep 10 18:59 K21acpid -> ../acpid lrwxrwxrwx 1 root root 7 Sep 10 18:59 K21dbus -> ../dbus lrwxrwxrwx 1 root root 8 Sep 10 18:59 K21fbset -> ../fbset lrwxrwxrwx 1 root root 16 Sep 10 18:59 K21microcode.ctl -> ../microcode.ctl lrwxrwxrwx 1 root root 9 Sep 10 18:59 K21random -> ../random lrwxrwxrwx 1 root root 9 Sep 10 18:59 K21resmgr -> ../resmgr lrwxrwxrwx 1 root root 8 Sep 10 18:59 S01acpid -> ../acpid lrwxrwxrwx 1 root root 7 Sep 10 18:59 S01dbus -> ../dbus lrwxrwxrwx 1 root root 8 Sep 10 18:59 S01fbset -> ../fbset lrwxrwxrwx 1 root root 16 Sep 10 18:59 S01microcode.ctl -> ../microcode.ctl lrwxrwxrwx 1 root root 9 Sep 10 18:59 S01random -> ../random lrwxrwxrwx 1 root root 9 Sep 10 18:59 S01resmgr -> ../resmgr lrwxrwxrwx 1 root root 13 Sep 10 18:59 S02consolekit -> ../consolekit lrwxrwxrwx 1 root root 12 Sep 10 18:59 S03haldaemon -> ../haldaemon lrwxrwxrwx 1 root root 10 Sep 10 18:59 S05network -> ../network lrwxrwxrwx 1 root root 9 Sep 10 18:59 S06syslog -> ../syslog lrwxrwxrwx 1 root root 9 Sep 10 18:59 S07auditd -> ../auditd lrwxrwxrwx 1 root root 10 Sep 10 18:59 S07portmap -> ../portmap lrwxrwxrwx 1 root root 15 Sep 10 18:59 S07splash_early -> ../splash_early lrwxrwxrwx 1 root root 8 Sep 10 18:59 S08smbfs -> ../smbfs lrwxrwxrwx 1 root root 12 Sep 10 19:13 S10alsasound -> ../alsasound lrwxrwxrwx 1 root root 15 Sep 10 18:59 S10avahi-daemon -> ../avahi-daemon lrwxrwxrwx 1 root root 7 Sep 10 18:59 S10cups -> ../cups lrwxrwxrwx 1 root root 19 Sep 10 19:03 S10java.binfmt_misc -> ../java.binfmt_misc lrwxrwxrwx 1 root root 6 Sep 10 18:59 S10kbd -> ../kbd lrwxrwxrwx 1 root root 7 Sep 10 18:59 S10nscd -> ../nscd lrwxrwxrwx 1 root root 13 Sep 10 19:04 S10powersaved -> ../powersaved lrwxrwxrwx 1 root root 9 Sep 10 18:59 S10splash -> ../splash lrwxrwxrwx 1 root root 7 Sep 10 18:59 S10sshd -> ../sshd lrwxrwxrwx 1 root root 9 Sep 17 19:15 S10vsftpd -> ../vsftpd lrwxrwxrwx 1 root root 17 Sep 10 18:59 S11avahi-dnsconfd -> ../avahi-dnsconfd lrwxrwxrwx 1 root root 10 Sep 10 18:59 S11postfix -> ../postfix lrwxrwxrwx 1 root root 10 Sep 17 19:03 S12apache2 -> ../apache2 lrwxrwxrwx 1 root root 7 Sep 12 17:45 S13cron -> ../cron lrwxrwxrwx 1 root root 9 Sep 12 17:45 S13smartd -> ../smartd lrwxrwxrwx 1 root root 15 Sep 10 18:59 S21stopblktrace -> ../stopblktrace |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|