This shows you the differences between two versions of the page.
— | redhat [2008/02/08 19:49] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== RedHat Linux Startup Script ====== | ||
+ | |||
+ | < | ||
+ | ---- SCRIPT START file called: popfile | ||
+ | -!/bin/sh | ||
+ | - | ||
+ | - Copyright (C) 2003 John Zoetebier < | ||
+ | - | ||
+ | - This program is free software; you can redistribute it and/or | ||
+ | - modify it under the terms of the GNU General Public License | ||
+ | - as published by the Free Software Foundation; either | ||
+ | - version 2 of the License, or (at your option) any later | ||
+ | - version. | ||
+ | - | ||
+ | - This program is distributed in the hope that it will be useful, | ||
+ | - but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
+ | - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
+ | - GNU General Public License for more details. | ||
+ | - | ||
+ | - You should have received a copy of the GNU General Public License | ||
+ | - along with this program; if not, write to the Free Software | ||
+ | - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
+ | - | ||
+ | - ============== | ||
+ | - History | ||
+ | - -------------- | ||
+ | - Modified by Peter Davie to include RedHat specific features (e.g. using the ' | ||
+ | - 19 Nov 2003 10:49am MYT | ||
+ | - | ||
+ | - NOTE TO PETER DAVIE: Please clarify whether or not this still works on SuSE after your changes. | ||
+ | - | ||
+ | - popfile | ||
+ | - | ||
+ | - A shell-script wrapper for popfile designed for use in the SysV-init | ||
+ | - system (/ | ||
+ | - | ||
+ | - | ||
+ | - usage: popfile { start | stop | restart | } | ||
+ | - | ||
+ | - See also: LSB, start_daemon (lsb), startproc (suse), install_initd (lsb), | ||
+ | - insserv (suse), / | ||
+ | - | ||
+ | |||
+ | - | ||
+ | - RedHat comment block... | ||
+ | - | ||
+ | - chkconfig: 345 80 20 | ||
+ | - description: | ||
+ | - pidfile: / | ||
+ | - | ||
+ | - | ||
+ | |||
+ | - | ||
+ | - LSB comment block... | ||
+ | - | ||
+ | - The bogus 345 run-levels are a workround for a buggy RedHat chkconfig which | ||
+ | - reads the LSB comment block (incorrectly) as an undocumented ' | ||
+ | - | ||
+ | - BEGIN INIT INFO | ||
+ | - Provides: popfile | ||
+ | - Required-Start: | ||
+ | - Required-Stop: | ||
+ | - Default-Start: | ||
+ | - Default-Stop: | ||
+ | - Description: | ||
+ | - END INIT INFO ## | ||
+ | |||
+ | - Source function library. | ||
+ | if [ -f / | ||
+ | < | ||
+ | elif [ -f / | ||
+ | < | ||
+ | else | ||
+ | < | ||
+ | fi | ||
+ | |||
+ | popfile_home=/ | ||
+ | popfile=" | ||
+ | |||
+ | - Setup variables | ||
+ | folder_saved=`pwd` | ||
+ | |||
+ | start() { | ||
+ | < | ||
+ | echo -n " | ||
+ | | ||
+ | echo -n " | ||
+ | # echo -en " | ||
+ | } | ||
+ | |||
+ | stop() { | ||
+ | < | ||
+ | | ||
+ | |||
+ | if [ " | ||
+ | echo " | ||
+ | else | ||
+ | kill $pid | ||
+ | fi | ||
+ | #echo -en " | ||
+ | echo success && echo</ | ||
+ | } | ||
+ | |||
+ | status() { | ||
+ | < | ||
+ | |||
+ | if [ " | ||
+ | echo " | ||
+ | else | ||
+ | echo " | ||
+ | | ||
+ | } | ||
+ | |||
+ | case " | ||
+ | start) | ||
+ | < | ||
+ | ;;</ | ||
+ | stop) | ||
+ | < | ||
+ | ;;</ | ||
+ | restart) | ||
+ | < | ||
+ | start | ||
+ | ;;</ | ||
+ | status) | ||
+ | < | ||
+ | ;;</ | ||
+ | *) | ||
+ | < | ||
+ | exit 1 | ||
+ | ;;</ | ||
+ | esac | ||
+ | |||
+ | - Back to original folder | ||
+ | cd $folder_saved | ||
+ | exit 0 | ||
+ | |||
+ | ---- SCRIPT END | ||
+ | |||
+ | </ | ||
Should you find anything in the documentation that is incomplete, unclear, outdated or just plain wrong, please let us know and leave a note in the Documentation Forum.