Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
howtos:linux [2007/01/24 09:41] mannihowtos:linux [2009/12/26 02:55] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== Startup / Shutdown Script for RedHat and Mandrake ====== +====== Linux Instructions ======
  
-All of the information below assumes you are logged in as root.+This page is a directory to specific instructions for certain Linux distributions. If you cannot find your distribution here, simply follow the [[:howtos:crossplatforminstall|Crossplatform installation instructions]].
  
-Here is a script for RedHat- it needs to reside in ///etc/init.d///+  * [[Fedora]] 
 +  * [[redhat_mandrake|RedHat]] 
 +  * [[redhat_mandrake|Mandrake]] 
 +  * [[SUSE]] 
 +  * [[Ubuntu]] 
 +  * [[Debian]]
  
-It is based on a script by John Zoetebier for SuSE (The HOWTO forum has the original [[http://sourceforge.net/forum/forum.php?thread_id=940236&forum_id=234504| script for SuSE]]). 
- 
-You might need to adjust the value of the popfile_home variable if you didn't install popfile to /usr/popfile 
-(e.g. popfile_home=/usr/local/popfile). 
- 
-you will also need to make a symbolic link (see below) in ///etc/rc0.d// and ///etc/rc3.d// 
- 
-you make the link as follows:<code> 
-ln -s /etc/init.d/popfile S??popfile 
-</code> 
-and  
- 
-<code>ln -s /etc/init.d/popfile K??popfile</code> 
- 
-  * where //??// is a number, e.g. 81, or a high number, but it must not be in use by any of the other scripts (do a ls of the directory and choose a non-used number). 
-  * The S = START 
-  * and the K = KILL 
- 
-These scripts are called by the system when it is shutting down the process or starting it at boot time. 
- 
-You only need to put a K??popfile entry in //rc0.d//, as this is the runlevel used when Linux shuts down. 
- 
-You will also need to make the 'popfile' script executable by typing: 
- 
-<code>chmod uga+x popfile</code> 
- 
-which makes it executable by everyone (all, group, user). If you only want root to run the script, then use: 
- 
-<code>chmod u+x popfile 
- 
- 
-  ---- SCRIPT START file called: popfile 
-  -!/bin/sh 
-  - 
-  - Copyright (C) 2003 John Zoetebier <[email protected]> 
-  - 
-  - 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 featues (e.g. using the 'functions' scripts) 
-  - 19 Nov 2003 10:49am MYT 
-  - 
-  - 
-  - popfile 
-  - 
-  - A shell-script wrapper for popfile designed for use in the SysV-init 
-  - system (/etc/init.d). 
-  - 
-  - 
-  - usage: popfile { start | stop | restart | } 
-  - 
-  - See also: LSB, start_daemon (lsb), startproc (suse), install_initd (lsb), 
-  - insserv (suse), /usr/share/doc/initscripts*/sysvinitfiles (redhat) 
-  - 
- 
-    - 
-  - RedHat comment block... 
-  - 
-  - chkconfig: 345 80 20 
-  - description: popfile is a POP3 proxy and mail filter 
-  - pidfile: /var/run/popfile.pid # processname: popfile 
-  - 
-  - 
- 
-    - 
-  - 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 'feature'. 
-  - 
-      - BEGIN INIT INFO 
-  - Provides: popfile 
-  - Required-Start: $network 
-  - Required-Stop: $network 
-  - Default-Start: 345 3 4 5 
-  - Default-Stop: 345 3 4 5 
-  - Description: popfile is a POP3 proxy and mail filter 
-      - END INIT INFO ## 
- 
-  - Source function library. 
-if [ -f /etc/init.d/functions ] ; then 
-<code> /etc/init.d/functions</code> 
-elif [ -f /etc/rc.d/init.d/functions ] ; then 
-<code> /etc/rc.d/init.d/functions</code> 
-else 
-<code> exit 0</code> 
-fi 
- 
-popfile_home=/usr/popfile 
-popfile="${popfile_home}/popfile.pl" # file must be executable, otherwise perl will not start 
- 
-  - Setup variables 
-folder_saved=`pwd` 
- 
-start() { 
-<code> cd ${popfile_home} 
- echo -n "Starting popfile: " 
- ${popfile} >> /dev/null 2>&1 & 
- echo -n "started as background process" && echo success && echo 
- # echo -en "\033[${RES_COL}G[  OK  ]"  -- Commented out PD, see history above.</code> 
-} 
- 
-stop() { 
-<code> echo -n "Stopping popfile ... " 
- pid=`ps -ef | grep perl | grep popfile.pl | gawk '{print $2}'` 
- 
- if [ "${pid}" = "" ] ; then 
-   echo "popfile is not running" 
- else 
-   kill $pid 
- fi 
- #echo -en "\033[${RES_COL}G[  OK  ]" 
- echo success && echo</code> 
-} 
- 
-status() { 
-<code> pid=`ps -ef | grep perl | grep popfile.pl | gawk '{print $2}'` 
- 
- if [ "${pid}" = "" ] ; then 
-   echo "stopped" 
- else 
-   echo "running" 
- fi</code> 
-} 
- 
-case "$1" in 
-start) 
-<code> start 
- ;;</code> 
-stop) 
-<code> stop 
- ;;</code> 
-restart) 
-<code> stop 
- start 
- ;;</code> 
-status) 
-<code> status 
- ;;</code> 
-  *) 
-<code> echo $"Usage: $0 {start|stop|restart|status}" 
- exit 1 
- ;;</code> 
-esac 
- 
-  - Back to original folder 
-cd $folder_saved 
-exit 0 
- 
-  ---- SCRIPT END</code> 
  
 
howtos/linux.1169631688.txt.gz · Last modified: 2008/02/08 19:49 (external edit)
Old revisions

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.

Recent changes RSS feed Donate Driven by DokuWiki
The content of this wiki is protected by the GNU Fee Documentation License