LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 02-22-2008, 06:55 PM   #1
testnbbuser
LQ Newbie
 
Registered: Nov 2007
Posts: 14

Rep: Reputation: 0
Loadproc and vsftpd


Hi all,

I am trying to use the blfs-bootscripts to boot a VSFTPD server that I compiled from source.

All goes well, but when I try to do a /etc/rc.d/init.d/vsftpd start
I got an error in the /etc/rc.d/init.d/functions saying:
line 508: 1557 Terminated nice -n "${nicelevel}" "${@}" [FAIL]

It seems that there is a problem with the nice command.

If I do /etc/rc.d/init.d/vsftpd stop it works properly and the service is stopped. The problem comes when I do the start.

The vsftpd binary is located in /usr/sbin/vsftpd and the my path environment variable is PATH=/bin:/sbin:/usr/bin:/usr/sbin:/tools/bin

Here is a copy of my /etc/rc.d/init.d/vsftpd script:

#!/bin/sh
# Begin $rc_base/init.d/vsftpd

# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org

. /etc/sysconfig/rc
. $rc_functions

case "$1" in
start)
boot_mesg "Starting vsFTPD Server..."
loadproc vsftpd
;;

stop)
boot_mesg "Stopping vsFTPD Server..."
killproc vsftpd
;;

reload)
boot_mesg "Reloading vsFTPD Server..."
reloadproc vsftpd
;;

restart)
$0 stop
sleep 1
$0 start
;;

status)
statusproc vsftpd
;;

*)
echo "Usage: $0 {start|stop|reload|restart|status}"
exit 1
;;
esac

# End $rc_base/init.d/vsftpd

and this is the whole function that drops the error in the file /etc/rc.d/init.d/functions :

#*******************************************************************************
# Function - loadproc [-f] [-n nicelevel] [-p pidfile] pathname [args]
#
# Purpose: This runs the specified program as a daemon
#
# Inputs: -f, run the program even if it is already running
# -n nicelevel, specifies a nice level. See nice(1).
# -p pidfile, uses the specified pidfile
# pathname, pathname to the specified program
# args, arguments to pass to specified program
#
# Outputs: return 0 - Success
# return 2 - Invalid of excessive arguments, warning in stdout
# return 4 - Program or service status is unknown
#
# Dependencies: nice
#
# Todo: LSB says this should be called start_daemon
# LSB does not say that it should call evaluate_retval
# It checks for PIDFILE, which is depreciated.
# Will be removed after BLFS 6.0
# loadproc returns 0 if program is already running, not LSB compliant
#
#*******************************************************************************
loadproc()
{
local pidfile=""
local forcestart=""
local nicelevel="10"

# This will ensure compatibility with previous LFS Bootscripts
if [ -n "${PIDFILE}" ]; then
pidfile="${PIDFILE}"
fi

while true
do
case "${1}" in
-f)
forcestart="1"
shift 1
;;
-n)
nicelevel="${2}"
shift 2
;;
-p)
pidfile="${2}"
shift 2
;;
-*)
log_failure_msg "Unknown Option: ${1}"
return 2 #invalid or excess argument(s)
;;
*)
break
;;
esac
done

if [ "${#}" = "0" ]; then
log_failure_msg "Usage: loadproc [-f] [-n nicelevel] [-p pidfile] pathname [args]"
return 2 #invalid or excess argument(s)
fi

if [ -z "${forcestart}" ]; then
if [ -z "${pidfile}" ]; then
pidofproc "${1}" > /dev/null
else
pidofproc -p "${pidfile}" "${1}" > /dev/null
fi

case "${?}" in
0)
log_warning_msg "Unable to continue: ${1} is running"
return 0 # 4
;;
1)
log_warning_msg "Unable to continue: ${pidfile} exists"
return 0 # 4
;;
3)
;;
*)
log_failure_msg "Unknown error code from pidofproc: ${?}"
return 4
;;
esac
fi

nice -n "${nicelevel}" "${@}"
evaluate_retval # This is "Probably" not LSB compliant, but required to be compatible with older bootscripts
return 0
}


Thanks in advance.

Last edited by testnbbuser; 02-22-2008 at 06:59 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
vsftpd settingd and VSFTPD DEAD BUT SUBSYS LOCKED pc_copat Linux - Newbie 15 11-05-2009 10:31 PM
vsftpd.conf/chroot/vsftpd.chroot_list issue Jerman Linux - Security 2 06-01-2007 07:24 PM
vsftpd, web uploads, vsftpd virtual users, apache virtual hosts, home directories jerryasher Linux - Software 7 02-18-2007 06:29 AM
vsftpd & ssl - how do I tell if it's actually vsftpd maintaining the connections?? hunterhunter Linux - General 0 03-27-2006 04:41 PM
VSFTPD with 500 oops :vsftpd: missing argv[0] mole_13 Linux - Newbie 0 05-04-2005 01:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 02:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration