Re: [lfs-support] ERROR: init-functions: start_daemon

2021-04-01 Thread Bruce Dubbs

On 4/1/21 7:15 PM, Scott Andrews wrote:


in init-functions start_daemon pidfile is not validated before removing...

code as follows


[snip]


     # Execute
     if [ -z "${force}" ]; then
     if [ -z "${pidfile}" ]; then
     # Determine the pid by discovery
     pidlist=`pidofproc "${1}"`
     retval="${?}"

    ^^

    needs to set pidfile here otherwise rm -f "${pidfile}" fails 
below


rm -f anything

will never fail unless it is a directory or there are permission problems.

-f, --force
   ignore nonexistent files and arguments, never prompt


  -- Bruce
--
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style


[lfs-support] ERROR: init-functions: killproc doesn't remove pid file after stopping process

2021-04-01 Thread Scott Andrews

case statement changes to

    case "${retval}" in
        0)    ;; # Program is running correctly
        1)    # Program is not running, but an invalid pid file exists
            # Remove the pid file.
            # If a PID file exists with that name, assume that is it.
            [ -z "${pidfile}" ] && pidfile="${program##*/}"
            [ -e "/run/${pidfile}" ] && rm -f "/run/${pidfile}" 2> 
/dev/null
            [ -e "/run/${pidfile}.pid" ] && rm -f "/run/${pidfile}.pid" 
2> /dev/null

            # This is only a success if no signal was passed.
            if [ -n "${nosig}" ]; then
                return 0
            else
                return 7
            fi
    ;;
        3)    # Program is not running and no pidfile exists
            # This is only a success if no signal was passed.
            if [[ -n "${nosig}" ]]; then return 0; else return 7; fi
    ;;
        *)    return 1 ;;
    esac



Add this to at the bottom of the function to fix

    # Check for and remove stale PID files.
    if ! kill -0 "${pid}" 2> /dev/null; then
        [ -z "${pidfile}" ] && pidfile="${program##*/}"
        [ -e "/run/${pidfile}" ] && rm -f "/run/${pidfile}" 2> /dev/null
        [ -e "/run/${pidfile}.pid" ] && rm -f "/run/${pidfile}.pid" 2> 
/dev/null

    fi

    return 0

}

--
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style


[lfs-support] ERROR: init-functions: start_daemon

2021-04-01 Thread Scott Andrews


in init-functions start_daemon pidfile is not validated before removing...

code as follows

start_daemon()
{
    local force=""
    local nice="0"
    local pidfile=""
    local pidlist=""
    local retval=""

    # Process arguments
    while true
    do
    case "${1}" in

    -f)
    force="1"
    shift 1
    ;;

    -n)
    nice="${2}"
    shift 2
    ;;

    -p)
    pidfile="${2}"
    shift 2
    ;;

    -*)
    return 2
    ;;

    *)
    program="${1}"
    break
    ;;
    esac
    done

    # Check for a valid program
    if [ ! -e "${program}" ]; then return 5; fi

    # Execute
    if [ -z "${force}" ]; then
    if [ -z "${pidfile}" ]; then
    # Determine the pid by discovery
    pidlist=`pidofproc "${1}"`
    retval="${?}"

   ^^

   needs to set pidfile here otherwise rm -f "${pidfile}" fails 
below


    else
    # The PID file contains the needed PIDs
    # Note that by LSB requirement, the path must be given to 
pidofproc,
    # however, it is not used by the current implementation or 
standard.

    pidlist=`pidofproc -p "${pidfile}" "${1}"`
    retval="${?}"

    fi

    # Return a value ONLY
    # It is the init script's (or distribution's functions) 
responsibilty

    # to log messages!
    case "${retval}" in

    0)
    # Program is already running correctly, this is a
    # successful start.
    return 0
    ;;

    1)
    # Program is not running, but an invalid pid file exists
    # remove the pid file and continue
    rm -f "${pidfile}"
    ^^^

    not valid or vaildated

--
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style


Re: [lfs-support] LFS translation to Ancient Greek completed

2021-04-01 Thread Alex Johns

On 1/04/21 11:32 pm, Rob Hudson wrote:

Tim Tassonis  wrote:
It took me a while, but I now finally completed my translation of the
LFS book into Ancient Greek. It is based on LFS 10.0, and only the sysv
version is done yet, Systemd is still pending due to ancient greek only
having capital letters.


Ha. Very good.
You actually did have me going there, for a while.


Me too!
--
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style


Re: [lfs-support] LFS translation to Ancient Greek completed

2021-04-01 Thread Ken Moffat
On Thu, Apr 01, 2021 at 12:01:14PM +0200, Tim Tassonis wrote:
> Hi all
> 
> It took me a while, but I now finally completed my translation of the LFS
> book into Ancient Greek. It is based on LFS 10.0, and only the sysv version
> is done yet, Systemd is still pending due to ancient greek only having
> capital letters.
> 
> Maybe this could be mentioned on the lfs Homepage?
> 
> Anybody interested might have a look here:
> 
> https://en.wikipedia.org/wiki/April_Fools'_Day
> 
> 
> 
> Bye
> Tim

Love it.

Ἓν οἶδα ὅτι οὐδὲν οἶδα

[ https://en.wikipedia.org/wiki/I_know_that_I_know_nothing ]

ĸen
-- 
Music teaches you to get past a mistake: If you make one when you play
live, you can't stop. You just have to carry on.   -- Richard Thompson
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style


Re: [lfs-support] ERROR: init-functions: killproc

2021-04-01 Thread Bruce Dubbs
I think you are right, but it's low priority right now.  We are really 
busy trying to get a new server set up properly.


For now there is
http://wiki.linuxfromscratch.org/lfs/ticket/4842

  -- Bruce

On 4/1/21 9:35 AM, Scott Andrews wrote:

This code is from killproc:

If killproc is called ( for example: /etc/init.d/sysklogd: killproc 
/sbin/klogd )


and the pid file exists and the process in not running:

then the case statement receives a 1 exit status from from 
pidlist=`pidofproc "${1}"` ,pidlist contains "" and pidfile is unset


so in processing that return status in the cast statement never removes 
the stale pid file as ${pidfile} is never set.



    # Check for a valid program
     if [ ! -e "${program}" ]; then return 5; fi

     # Check for a valid signal
     check_signal "${signal}"
     if [ "${?}" -ne "0" ]; then return 2; fi

     # Get a list of pids
     if [ -z "${pidfile}" ]; then
     # determine the pid by discovery
     pidlist=`pidofproc "${1}"`
     retval="${?}"
     else
     # The PID file contains the needed PIDs
     # Note that by LSB requirement, the path must be given to 
pidofproc,
     # however, it is not used by the current implementation or 
standard.

     pidlist=`pidofproc -p "${pidfile}" "${1}"`
     retval="${?}"
     fi

     # Return a value ONLY
     # It is the init script's (or distribution's functions) responsibilty
     # to log messages!
     case "${retval}" in

     0)
     # Program is running correctly
     # Do nothing here, let killproc continue.
     ;;

     1)
     # Program is not running, but an invalid pid file exists
     # Remove the pid file.
     rm -f "${pidfile}"

     # This is only a success if no signal was passed.
     if [ -n "${nosig}" ]; then
     return 0
     else
     return 7
     fi
     ;;


Suggest the following.

     1)
     # Program is not running, but an invalid pid file exists
     # Remove the pid file

             progname=${program##*/}
             if [[ -e "/run/${progname}.pid" ]]; then

     pidfile="/run/${progname}.pid"

             rm -f "${pidfile}"

     fi

     # This is only a success if no signal was passed.
     if [ -n "${nosig}" ]; then
     return 0
     else
     return 7
     fi

Or

     1)
     # Program is not running, but an invalid pid file exists
     # Remove the pid file

             progname=${program##*/}
             if [[ -e "/run/${progname}.pid" ]]; then rm -f 
"/run/${progname}.pid"; fi


     # This is only a success if no signal was passed.
     if [ -n "${nosig}" ]; then
     return 0
     else
     return 7
     fi



--
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style


[lfs-support] ERROR: init-functions: killproc

2021-04-01 Thread Scott Andrews

This code is from killproc:

If killproc is called ( for example: /etc/init.d/sysklogd: killproc 
/sbin/klogd )


and the pid file exists and the process in not running:

then the case statement receives a 1 exit status from from 
pidlist=`pidofproc "${1}"` ,pidlist contains "" and pidfile is unset


so in processing that return status in the cast statement never removes 
the stale pid file as ${pidfile} is never set.



   # Check for a valid program
    if [ ! -e "${program}" ]; then return 5; fi

    # Check for a valid signal
    check_signal "${signal}"
    if [ "${?}" -ne "0" ]; then return 2; fi

    # Get a list of pids
    if [ -z "${pidfile}" ]; then
    # determine the pid by discovery
    pidlist=`pidofproc "${1}"`
    retval="${?}"
    else
    # The PID file contains the needed PIDs
    # Note that by LSB requirement, the path must be given to 
pidofproc,
    # however, it is not used by the current implementation or 
standard.

    pidlist=`pidofproc -p "${pidfile}" "${1}"`
    retval="${?}"
    fi

    # Return a value ONLY
    # It is the init script's (or distribution's functions) responsibilty
    # to log messages!
    case "${retval}" in

    0)
    # Program is running correctly
    # Do nothing here, let killproc continue.
    ;;

    1)
    # Program is not running, but an invalid pid file exists
    # Remove the pid file.
    rm -f "${pidfile}"

    # This is only a success if no signal was passed.
    if [ -n "${nosig}" ]; then
    return 0
    else
    return 7
    fi
    ;;


Suggest the following.

    1)
    # Program is not running, but an invalid pid file exists
    # Remove the pid file

            progname=${program##*/}
            if [[ -e "/run/${progname}.pid" ]]; then

    pidfile="/run/${progname}.pid"

            rm -f "${pidfile}"

    fi

    # This is only a success if no signal was passed.
    if [ -n "${nosig}" ]; then
    return 0
    else
    return 7
    fi

Or

    1)
    # Program is not running, but an invalid pid file exists
    # Remove the pid file

            progname=${program##*/}
            if [[ -e "/run/${progname}.pid" ]]; then rm -f 
"/run/${progname}.pid"; fi


    # This is only a success if no signal was passed.
    if [ -n "${nosig}" ]; then
    return 0
    else
    return 7
    fi

--
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style


Re: [lfs-support] LFS translation to Ancient Greek completed

2021-04-01 Thread Rob Hudson
Tim Tassonis  wrote:
It took me a while, but I now finally completed my translation of the 
LFS book into Ancient Greek. It is based on LFS 10.0, and only the sysv 
version is done yet, Systemd is still pending due to ancient greek only 
having capital letters.


Ha. Very good.
You actually did have me going there, for a while.
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style


Re: [lfs-support] LFS translation to Ancient Greek completed

2021-04-01 Thread Xi Ruoyao
On 2021-04-01 12:01 +0200, Tim Tassonis wrote:
> Hi all
> 
> It took me a while, but I now finally completed my translation of the 
> LFS book into Ancient Greek. It is based on LFS 10.0, and only the sysv 
> version is done yet, Systemd is still pending due to ancient greek only 
> having capital letters.
> 
> Maybe this could be mentioned on the lfs Homepage?
> 
> Anybody interested might have a look here:
> 
> https://en.wikipedia.org/wiki/April_Fools'_Day

Unfortunately, due to the migration from higgs to rivendell, LFS website is now
under a freezing.  Maybe we can add a link to it on Apr. 1 2022 :).
-- 
Xi Ruoyao 
School of Aerospace Science and Technology, Xidian University

-- 
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style


[lfs-support] LFS translation to Ancient Greek completed

2021-04-01 Thread Tim Tassonis

Hi all

It took me a while, but I now finally completed my translation of the 
LFS book into Ancient Greek. It is based on LFS 10.0, and only the sysv 
version is done yet, Systemd is still pending due to ancient greek only 
having capital letters.


Maybe this could be mentioned on the lfs Homepage?

Anybody interested might have a look here:

https://en.wikipedia.org/wiki/April_Fools'_Day



Bye
Tim
--
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style