Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How i must write "openrc-run" script for launch at boot
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
Inukaze
n00b
n00b


Joined: 31 Dec 2016
Posts: 20
Location: Venezuela

PostPosted: Fri Sep 07, 2018 1:27 pm    Post subject: How i must write "openrc-run" script for launch at Reply with quote

Hi there. right now i am using Devuan with OpenRC. some weeks ago, i found this -> https://forums.gentoo.org/viewtopic-t-715564-start-0.html

And after i post on the Devuan Forum, that solution -> https://dev1galaxy.org/viewtopic.php?pid=11304#p11304

The thing was, some days after. i upgrade the package on my system. and the script right now don't work
i started the theme here -> https://dev1galaxy.org/viewtopic.php?id=2339

Well right now nobody knows how i must write a script for OpenRC. i just put the follow :
Code:
#!/bin/sh

### BEGIN INIT INFO
# Provides:          noip2
# Required-Start:    $local_fs
# Required-Stop:     $local_fs
# Should-Start:      autofs $network
# Should-Stop:       autofs $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: NoIP
# Description:       Inicia el Servicio noip2
#                    Para conectarse a traves de internet usando un nombre y no la IP{v4,6}
### END INIT INFO

. /lib/lsb/init-functions

PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=noip2
DESC="noip2"
DAEMON=/usr/bin/noip2

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

#PIDFILE=$(sed -n 's/^[[:space:]]*pid_file[[:space:]]*"\?\([^"]*\)\"\?/\1/p' $NOIP2CONF)
PIDFILE=$(mkdir -p /run/noip2 ; echo "$RANDOM" >> pid)
noip2_start () {
   echo "Iniciando noip2."
        "$DAEMON" 2>/dev/null
}

noip2_stop () {
   echo -n "Finalizando noip2 : "
   kill -15 $(pgrep noip2)
}

# note to self: don't call the non-standard args for this in
# {post,pre}{inst,rm} scripts since users are not forced to upgrade
# /etc/init.d/noip2 when noip2 is updated
case "$1" in
    start)
        noip2_start
        ;;
    stop)
        noip2_stop
        ;;
    restart)
        noip2_stop
        noip2_start
        ;;
    *)
        echo "Usage: $0 {start|stop|restart}"
        exit 2
        ;;
esac


Well the thing is, this script, for me is not 100% right, because during boot not showing for example :
[ ok ] Initializing NoIP2

Dont generate a PID file for the system check if running or not. on my first try, i use "mpd" script copy and just modify the necesary. but the follow part don't work for me

ok the main modification was things like :

Code:
MPDCONF=/etc/mpd.conf by NOIP2CONF=/usr/etc/no-ip2.conf
DAEMON=/usr/bin/noip2


and well the unique thing i don't understand what do is the line :
Code:
PIDFILE=$(sed -n 's/^[[:space:]]*pid_file[[:space:]]*"\?\([^"]*\)\"\?/\1/p' $MPDCONF)


because with mpd :

Code:
echo $PIDFILE
/run/mpd/pid


if i try with my modification
Code:
PIDFILE=$(sed -n 's/^[[:space:]]*pid_file[[:space:]]*"\?\([^"]*\)\"\?/\1/p' $NOIP2CONF)

echo $PIDFILE
 


nothing happened. because i don't understand what are doing that line of PIDFILE.
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10587
Location: Somewhere over Atlanta, Georgia

PostPosted: Fri Sep 07, 2018 2:47 pm    Post subject: Reply with quote

Moved from Portage & Programming to Unsupported Software. Support question is about Devuan so it fits better here. Not a bad choice to post on the Gentoo Forums, though.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
Inukaze
n00b
n00b


Joined: 31 Dec 2016
Posts: 20
Location: Venezuela

PostPosted: Fri Sep 07, 2018 2:54 pm    Post subject: Reply with quote

Both distro uses OpenRC. and i just asking how i must write a script for OpenRC. not for specific distribution.
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10587
Location: Somewhere over Atlanta, Georgia

PostPosted: Fri Sep 07, 2018 2:59 pm    Post subject: Reply with quote

Sure, I understand. However, all support forums except Unsupported Software are for questions from people actually using Gentoo Linux. But, like I said, good call to post here: there's a fair amount of OpenRC knowledge among the members here.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
guitou
Guru
Guru


Joined: 02 Oct 2003
Posts: 534
Location: France

PostPosted: Fri Sep 07, 2018 4:30 pm    Post subject: Reply with quote

Hi.
Not using openrc anymore, and not currently running gentoo, but still hanging around, and at least I can tell a little about the sed command you did try:
Code:
PIDFILE=$(sed -n 's/^[[:space:]]*pid_file[[:space:]]*"\?\([^"]*\)\"\?/\1/p' $NOIP2CONF)


This line assigns the result of a sed command to PIDFILE.
About sed command:
-option -n makes sed silent.
-'s/search/replacement/p' prints the replacement for each line matching the search pattern.
In your case the search pattern is any number of spaces followed by pid_file followed any number of spaces again followed by anything between double quotes or not.
In the search expression, parenthesis are used to store a reference (here the anything between double quotes or not), and the replace expression is the first and only reference

For this to work, you need $NOIP2CONF file (/usr/etc/no-ip2.conf) to exist and to contain a matching line (eg smth like 'pid_file xxxx' or 'pid_file "xxxx"' or even 'pid_file "xxxx' btw). You may look at the matching line in your /etc/mpd.conf (or try: sed -n 's/^[[:space:]]*pid_file[[:space:]]*"\?\([^"]*\)\"\?/\1/p' /etc/mpd.conf)

The alternative might be discussed too:
Code:
PIDFILE=$(mkdir -p /run/noip2 ; echo "$RANDOM" >> pid)


This code is just wrong:
Globally, you try to set a variable supposed to contain path to a PID file, using a command that failingly tries to set the PID file but does not output anything: PIDFILE will always be empty! In fact I guess you could simply try PIDFILE=/run/noip2/pid here.
And regarding the 2 inner commands, no matter how useless here, first one creates a directory, and second one does create a file named pid with random content in the current working directory, probably not where expected!
Last, I may tell bullshit, but I fear random content is a bad idea for a PID file, as the intent is to store the actual pid of a process.

Hope this helps a little.

++
Gi)
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Fri Sep 07, 2018 6:22 pm    Post subject: Re: How i must write "openrc-run" script for launc Reply with quote

Inukaze ... absolutely no knowlege of devuan, or how it's using openrc, but here are some general pointers:

Inukaze wrote:
Code:
#!/bin/sh

openrc initscripts (in their current incarnation) have the shebang '#!/sbin/openrc-run', if runing via /bin/sh you won't get various rc builtins (like 'ebegin', 'einfo', 'eend', 'eerror', etc) and so you won't get "Initializing NoIP2 .... [OK]" (and other output).

Inukaze wrote:
Code:
### BEGIN INIT INFO
# Provides:          noip2
# Required-Start:    $local_fs
# Required-Stop:     $local_fs
# Should-Start:      autofs $network
# Should-Stop:       autofs $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: NoIP
# Description:       Inicia el Servicio noip2
#                    Para conectarse a traves de internet usando un nombre y no la IP{v4,6}
### END INIT INFO

Have to laugh at that, looks like a leftover from debian's sysvrc crapfest. Besides the (obselete) sysvinit runlevels, openrc comes with 'use', 'need', 'after', 'before', 'provide', etc, for service dependencies ... but none of that seems to be used here (I expect to keep some conformity with LSB, sysvrc, or historical bagage).

Inukaze wrote:
Code:
. /lib/lsb/init-functions

More giggles ... could be /lib/rc/sh/functions.sh ... who knows.

Inukaze wrote:
Code:
PATH=/sbin:/bin:/usr/sbin:/usr/bin

The fact that you're not using '#!/sbin/openrc-run', or don't have /lib/rc/bin in PATH, it's almost like you're not using openrc at all :)

Inukaze wrote:
Code:
NAME=noip2
DESC="noip2"
DAEMON=/usr/bin/noip2

Well, no ... that's not openrc syntax at all ...

Code:
description="Dynamic hostname client"

Inukaze wrote:
Code:
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

No, you do not want that, "fail, and fail loudly!!!", if the execuable doesn't exist then the retval should be an error. Anyhow, such checks (if necessary) should be in start_pre(), or asigned and then passed to start-stop-daemon's '--exec' (see bellow).

Code:
noip2_binary=${noip2_binary:-/usr/bin/noip2}

Inukaze wrote:
Code:
#PIDFILE=$(sed -n 's/^[[:space:]]*pid_file[[:space:]]*"\?\([^"]*\)\"\?/\1/p' $NOIP2CONF)
PIDFILE=$(mkdir -p /run/noip2 ; echo "$RANDOM" >> pid)

/run/noip2 a directory? If so, then:

Code:
pidfile="/var/run/noip2/noip2.pid"
command_args="-D ${pidfile}"
[...]
start_pre() {
        # set permissions, and ownership, appropriately
        checkpath -d -m 0755 -o root:root /var/run/noip2
}

Inukaze wrote:
Code:
noip2_start () {
        echo "Iniciando noip2."
        "$DAEMON" 2>/dev/null
}

Not sure why this is a function, it looks to me like this should be under start() ... anyhow, you should be using and 'ebegin', 'eend', and (probably) 'start-stop-daemon'.

Code:
start() {
        ebegin "Starting ${SVCNAME}"
        start-stop-daemon --start --pidfile "${pidfile}"--exec "${noip2_binary}" -- "${command_args}"
        eend $?

Inukaze wrote:
Code:
noip2_stop () {
   echo -n
   kill -15 $(pgrep noip2)
}

Same thing here ... only without the lonely echo :)

Code:
stop() {
        ebegin "Stopping ${SVCNAME}"
        start-stop-daemon --stop --pidfile "${pidfile}"
        eend $?
}

HTH & best ... khay
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Fri Sep 07, 2018 11:35 pm    Post subject: Reply with quote

Inukaze ... just noticed that the 'mv' overlay has 'net-dns/noip-updater' (noip2) with the following initscript

noip2:
#!/sbin/openrc-run

depend() {
   need localmount
   need net
   use dns
}

checkconfig() {
   if [ ! -f /etc/no-ip2.conf ]
   then
      einfo "Answer the following questions about your no-ip account."
      noip2 -C || return 1
   fi
}

start() {
   checkconfig || return 1
   ebegin "Starting noip"
   start-stop-daemon --quiet --start -x /usr/sbin/noip2 -- -c /etc/no-ip2.conf
   eend $? "noip did not start, error code $?"
}

stop() {
   ebegin "Stopping noip"
   start-stop-daemon --quiet --stop -x /usr/sbin/noip2
   noip_ecode=$?
   eend $noip_ecode "Error stopping the noip daemon, error $noip_ecode"
   checkconfig || return 1
   ebegin "Setting noip addresses to 0.0.0.0"
   noip2 -c /etc/no-ip2.conf -i 0.0.0.0 >/dev/null 2>&1
   eend $? "Failed to set noip addresses to 0.0.0.0, error $?"
   return $noip_ecode
}

I would expect that to work without modification (with openrc), but I probably wouldn't be asking for user input in checkconfg() ... anyhow, it should give you a clear idea of how such an openrc initscript should look.

Again HTH & best ... khay
Back to top
View user's profile Send private message
Inukaze
n00b
n00b


Joined: 31 Dec 2016
Posts: 20
Location: Venezuela

PostPosted: Sat Sep 08, 2018 9:44 am    Post subject: Reply with quote

Hi there i put the follow code :

Code:
#!/sbin/openrc-run

depend() {
#   need localmount
#   need net
   use dns
}

checkconfig() {
   if [ ! -f /etc/no-ip2.conf ]
   then
      einfo "Answer the following questions about your no-ip account."
      noip2 -C || return 1
   fi
}

start() {
   checkconfig || return 1
   ebegin "Starting noip"
   start-stop-daemon --quiet --start -x /usr/bin/noip2 -- -c /etc/no-ip2.conf
   eend $? "noip did not start, error code $?"
}

stop() {
   ebegin "Stopping noip"
   start-stop-daemon --quiet --stop -x /usr/bin/noip2
   noip_ecode=$?
   eend $noip_ecode "Error stopping the noip daemon, error $noip_ecode"
   checkconfig || return 1
   ebegin "Setting noip addresses to 0.0.0.0"
   noip2 -c /etc/no-ip2.conf -i 0.0.0.0 >/dev/null 2>&1
   eend $? "Failed to set noip addresses to 0.0.0.0, error $?"
   return $noip_ecode
}


and well during boot don't start, just when i reach my desktop and use
Code:
su -c "rc-service noip2 start" root
Password :
 * Starting noip ...                                                                            [ ok ]


i should comment "localmount" and "net", because if are activated, i got errors.
Code:
su -c "rc-service noip2 start" root
Contraseña:
 * ERROR: noip2 needs service(s) localmount, net


Commenting localmount and trying to start :
Code:
su -c "rc-service noip2 start" root
Contraseña:
 * Caching service dependencies ...
Service `noip2' needs non existent service `net'
Service `noip2~' needs non existent service `localmount'
Service `noip2~' needs non existent service `net'
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> single u> stop-bootlogd u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> single u> stop-bootlogd u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> single u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> stop-bootlogd u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> stop-bootlogd u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> single u> stop-bootlogd u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> single u> stop-bootlogd u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> single u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> stop-bootlogd u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> stop-bootlogd u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> single u> stop-bootlogd u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> single u> stop-bootlogd u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> single u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> single u> stop-bootlogd u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> single u> stop-bootlogd u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> single u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> stop-bootlogd u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> stop-bootlogd u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> stop-bootlogd u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> stop-bootlogd u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> rmnologin u> single u> stop-bootlogd u> rc.local.
 * Found a solvable dependency loop: rc.local u> rmnologin u> single u> stop-bootlogd u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rmnologin u> single u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rmnologin u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rmnologin u> stop-bootlogd u> rc.local.
 * Found a solvable dependency loop: rc.local u> rmnologin u> stop-bootlogd u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rmnologin u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rmnologin u> rc.local.
 * Found a solvable dependency loop: rc.local u> single u> stop-bootlogd u> rc.local.
 * Found a solvable dependency loop: rc.local u> single u> stop-bootlogd u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> single u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd-single u> rc.local.
 * Solving the loop by breaking rc.local u> rc.local~.
 * Solving the loop by breaking rc.local~ u> rmnologin.
 * Solving the loop by breaking single u> stop-bootlogd.
 * Solving the loop by breaking rmnologin u> single.
 * Solving the loop by breaking stop-bootlogd u> rc.local.
 * Solving the loop by breaking stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd-single u> rc.local~ u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd-single u> rc.local~ u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd-single u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd-single u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd-single u> rmnologin u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd-single u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> rc.local~ u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> rc.local~ u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> stop-bootlogd-single u> rc.local~ u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> stop-bootlogd-single u> rc.local~ u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> stop-bootlogd-single u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> stop-bootlogd-single u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> rmnologin u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> rmnologin u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> stop-bootlogd-single u> rmnologin u> rc.local.
 * Found a solvable dependency loop: rc.local u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> stop-bootlogd-single u> single u> rc.local.
 * Solving the loop by breaking rc.local u> stop-bootlogd-single.
 * Solving the loop by breaking stop-bootlogd-single u> rc.local~.
 * Solving the loop by breaking stop-bootlogd u> rc.local~.
 * Solving the loop by breaking single u> rc.local.
 * Solving the loop by breaking rc.local~ u> single.
 * Solving the loop by breaking rmnologin u> rc.local.
 * Found a solvable dependency loop: rc.local u> rmnologin u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> rmnologin u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> rmnologin u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> rmnologin u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> single u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> single u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> single u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> single u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> stop-bootlogd-single u> rmnologin u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> stop-bootlogd-single u> rmnologin u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> stop-bootlogd-single u> single u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> stop-bootlogd-single u> single u> rc.local~ p> rc.local.
 * Solving the loop by breaking rc.local u> rmnologin.
 * Solving the loop by breaking stop-bootlogd u> rmnologin.
 * Solving the loop by breaking rmnologin u> rc.local~.
 * Solving the loop by breaking single u> rc.local~.
 * Solving the loop by breaking stop-bootlogd-single u> rmnologin.
 * Found a solvable dependency loop: rmnologin u> stop-bootlogd u> single u> rmnologin.
 * Found a solvable dependency loop: rmnologin u> stop-bootlogd u> stop-bootlogd-single u> single u> rmnologin.
 * Found a solvable dependency loop: rmnologin u> stop-bootlogd-single u> single u> rmnologin.
 * Solving the loop by breaking single u> rmnologin.
 * Solving the loop by breaking rmnologin u> stop-bootlogd.
 * Solving the loop by breaking stop-bootlogd u> single.
 * Found a solvable dependency loop: single u> stop-bootlogd-single u> single.
 * Solving the loop by breaking stop-bootlogd-single u> single.
 * Found a solvable dependency loop: stop-bootlogd u> stop-bootlogd-single u> stop-bootlogd.
 * Solving the loop by breaking stop-bootlogd-single u> stop-bootlogd.                          [ ok ]
 * ERROR: noip2 needs service(s) net


with localmount and net commented :
Code:
su -c "rc-service noip2 start" root
Contraseña:
 * Caching service dependencies ...
Service `noip2~' needs non existent service `net'
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> single u> stop-bootlogd u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> single u> stop-bootlogd u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> single u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> stop-bootlogd u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> stop-bootlogd u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> single u> stop-bootlogd u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> single u> stop-bootlogd u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> single u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> stop-bootlogd u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> stop-bootlogd u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> rmnologin u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> single u> stop-bootlogd u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> single u> stop-bootlogd u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> single u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> single u> stop-bootlogd u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> single u> stop-bootlogd u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> single u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> stop-bootlogd u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> stop-bootlogd u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> stop-bootlogd u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> stop-bootlogd u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> rmnologin u> single u> stop-bootlogd u> rc.local.
 * Found a solvable dependency loop: rc.local u> rmnologin u> single u> stop-bootlogd u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rmnologin u> single u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rmnologin u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rmnologin u> stop-bootlogd u> rc.local.
 * Found a solvable dependency loop: rc.local u> rmnologin u> stop-bootlogd u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rmnologin u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> rmnologin u> rc.local.
 * Found a solvable dependency loop: rc.local u> single u> stop-bootlogd u> rc.local.
 * Found a solvable dependency loop: rc.local u> single u> stop-bootlogd u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> single u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd-single u> rc.local.
 * Solving the loop by breaking rc.local u> rc.local~.
 * Solving the loop by breaking rc.local~ u> rmnologin.
 * Solving the loop by breaking single u> stop-bootlogd.
 * Solving the loop by breaking rmnologin u> single.
 * Solving the loop by breaking stop-bootlogd u> rc.local.
 * Solving the loop by breaking stop-bootlogd-single u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd-single u> rc.local~ u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd-single u> rc.local~ u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd-single u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd-single u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd-single u> rmnologin u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd-single u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> rc.local~ u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> rc.local~ u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> stop-bootlogd-single u> rc.local~ u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> stop-bootlogd-single u> rc.local~ u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> stop-bootlogd-single u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> stop-bootlogd-single u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> rmnologin u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> rmnologin u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> stop-bootlogd-single u> rmnologin u> rc.local.
 * Found a solvable dependency loop: rc.local u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> single u> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> stop-bootlogd-single u> single u> rc.local.
 * Solving the loop by breaking rc.local u> stop-bootlogd-single.
 * Solving the loop by breaking stop-bootlogd-single u> rc.local~.
 * Solving the loop by breaking stop-bootlogd u> rc.local~.
 * Solving the loop by breaking single u> rc.local.
 * Solving the loop by breaking rc.local~ u> single.
 * Solving the loop by breaking rmnologin u> rc.local.
 * Found a solvable dependency loop: rc.local u> rmnologin u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> rmnologin u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> rmnologin u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> rmnologin u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> single u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> single u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> single u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> single u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> stop-bootlogd-single u> rmnologin u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> stop-bootlogd-single u> rmnologin u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> stop-bootlogd-single u> single u> rc.local~ p> rc.local.
 * Found a solvable dependency loop: rc.local u> stop-bootlogd u> stop-bootlogd-single u> single u> rc.local~ p> rc.local.
 * Solving the loop by breaking rc.local u> rmnologin.
 * Solving the loop by breaking stop-bootlogd u> rmnologin.
 * Solving the loop by breaking rmnologin u> rc.local~.
 * Solving the loop by breaking single u> rc.local~.
 * Solving the loop by breaking stop-bootlogd-single u> rmnologin.
 * Found a solvable dependency loop: rmnologin u> stop-bootlogd u> single u> rmnologin.
 * Found a solvable dependency loop: rmnologin u> stop-bootlogd u> stop-bootlogd-single u> single u> rmnologin.
 * Found a solvable dependency loop: rmnologin u> stop-bootlogd-single u> single u> rmnologin.
 * Solving the loop by breaking single u> rmnologin.
 * Solving the loop by breaking rmnologin u> stop-bootlogd.
 * Solving the loop by breaking stop-bootlogd u> single.
 * Found a solvable dependency loop: single u> stop-bootlogd-single u> single.
 * Solving the loop by breaking stop-bootlogd-single u> single.
 * Found a solvable dependency loop: stop-bootlogd u> stop-bootlogd-single u> stop-bootlogd.
 * Solving the loop by breaking stop-bootlogd-single u> stop-bootlogd.                          [ ok ]
 * Starting noip ...                                                                            [ ok ]


if i try to stop it :
Code:
su -c "rc-service noip2 stop" root
Contraseña:
 * Stopping noip ...                                                                            [ ok ]
 * Setting noip addresses to 0.0.0.0 ...
 * Failed to set noip addresses to 0.0.0.0, error 255                                           [ !! ]


Right now the code of /etc/init.d/noip2 is :
Code:
#!/sbin/openrc-run

description="Start/Stop the no-ip daemon"

depend()
{
        after *
        keyword notimeout
}

checkconfig() {
   if [ ! -f /etc/no-ip2.conf ]
   then
      einfo "Answer the following questions about your no-ip account."
      noip2 -C || return 1
   fi
}

start()
{
   checkconfig || return 1
        ebegin "Starting NoIP"

        start-stop-daemon --quiet --start -x /usr/bin/noip2 -- -c /etc/no-ip2.conf
        eend $? "Failed to start NoIP"
}

stop()
{
        ebegin "Stopping NoIP"
   start-stop-daemon --quiet --stop -x /usr/bin/noip2
        eend $? $"Failed to stop NoIP"
}


But i can't understand don't run at boot. let me check again the Gentoo Wiki -> https://wiki.gentoo.org/wiki/Handbook:X86/Working/Initscripts#Initscripts

Code:
su -c "cat /etc/inittab" root
Contraseña :

# /etc/inittab: init(8) configuration.
# $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $

# The default runlevel.
id:2:initdefault:

# Boot-time system configuration/initialization script.
# This is run first except when booting in emergency (-b) mode.
si::sysinit:/etc/init.d/rcS

# What to do in single-user mode.
~~:S:wait:/sbin/sulogin

# /etc/init.d executes the S and K scripts upon change
# of runlevel.
#
# Runlevel 0 is halt.
# Runlevel 1 is single-user.
# Runlevels 2-5 are multi-user.
# Runlevel 6 is reboot.

l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6
# Normally not reached, but fallthrough in case of emergency.
z6:6:respawn:/sbin/sulogin

# What to do when CTRL-ALT-DEL is pressed.
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

# Action on special keypress (ALT-UpArrow).
#kb::kbrequest:/bin/echo "Keyboard Request--edit /etc/inittab to let this work."

# What to do when the power fails/returns.
pf::powerwait:/etc/init.d/powerfail start
pn::powerfailnow:/etc/init.d/powerfail now
po::powerokwait:/etc/init.d/powerfail stop

# /sbin/getty invocations for the runlevels.
#
# The "id" field MUST be the same as the last
# characters of the device (after "tty").
#
# Format:
#  <id>:<runlevels>:<action>:<process>
#
# Note that on most Debian systems tty7 is used by the X Window System,
# so if you want to add more getty's go ahead but skip tty7 if you run X.
#
1:2345:respawn:/sbin/getty 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
4:23:respawn:/sbin/getty 38400 tty4
5:23:respawn:/sbin/getty 38400 tty5
#6:23:respawn:/sbin/getty 38400 tty6
6:23:respawn:/sbin/getty 38400 --autologin inukaze --noclear tty6
#1:2345:respawn:/bin/login -f inukaze tty6 </dev/tty6 >/dev/tty6 2>&1

# Example how to put a getty on a serial line (for a terminal)
#
#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
#T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100

# Example how to put a getty on a modem line.
#
#T3:23:respawn:/sbin/mgetty -x0 -s 57600 ttyS3

#CS:123456:respawn:/opt/gitlab/embedded/bin/runsvdir-start


Ok possible something missing, i see this lines is not there :
Code:
si::sysinit:/sbin/openrc sysinit
rc::bootwait:/sbin/openrc boot


But i dont know where i should put that lines.

Well i try the follow :
Code:
# Boot-time system configuration/initialization script.
# This is run first except when booting in emergency (-b) mode.
si::sysinit:/sbin/openrc sysinit   #Inukaze
rc::bootwait:/sbin/openrc boot      #Inukaze
#si::sysinit:/etc/init.d/rcS      #Default System


The system boots normally. but the script don't start at boot.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Sat Sep 08, 2018 1:45 pm    Post subject: Reply with quote

Inukaze wrote:
Code:
depend() {
#   need localmount
#   need net
   use dns
}

and well during boot don't start, just when i reach my desktop and use su -c "rc-service noip2 start"

Inukaze ... 'depend()' defines important dependency information, the service 'localmount', and the 'net' target, must be met/active, for the service to start, without them noip2 will attempt to aquire and IP when no network is available. In deuvan's case these services/targets don't exist, as it looks like (from the inittab) deuvan is attempting to have openrc function like it's old sysvrc/sysvinit... and so go against the saner approach provided by openrc (debian's sysvrc is, as I said, a crapfest).

Inukaze wrote:
Well i try the follow :
Code:
si::sysinit:/sbin/openrc sysinit   #Inukaze
rc::bootwait:/sbin/openrc boot      #Inukaze
#si::sysinit:/etc/init.d/rcS      #Default System

By the looks of things you don't have those runlevels ... at this point I'm not sure you have any runlevels at all (your just running /etc/init.d/rcS, etc).

Code:
# print -rl /etc/runlevels/{boot,sysinit}
/etc/runlevels/boot
/etc/runlevels/sysinit

best ... khay
Back to top
View user's profile Send private message
Inukaze
n00b
n00b


Joined: 31 Dec 2016
Posts: 20
Location: Venezuela

PostPosted: Sat Sep 08, 2018 10:57 pm    Post subject: Reply with quote

Code:
su -c "print -rl /etc/runlevels/{boot,sysinit}" root
Contraseña:
Error: no such file ":-rl"
Error: no "print" mailcap rules found for type "inode/directory"
Error: no "print" mailcap rules found for type "inode/directory"


Which specfic information you need to know?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Sun Sep 09, 2018 12:01 am    Post subject: Reply with quote

Inukaze wrote:
Which specfic information you need to know?

Inukaze ... 'print' is a zsh builtin, bash doesn't have it, anyhow, the contents of /etc/runlevel, or 'rc-status --list' ... but by the inittab you provided devuan doesn't have runlevels it calls /etc/init.d/rc <sysvinit_runlevel>. I'm not sure I can help really, because I'm not willing to spend the time to figure out exactly how openrc on devuan is setup, it seems totally convoluted, if not broken, to me. If an openrc initscript from gentoo doesn't work on devuan then its because they have altered openrc's basic operation to such a degree that it's nolonger openrc, such initscripts should be mostly interoperable, but that doesn't seem to be the case.

best ... khay
Back to top
View user's profile Send private message
Inukaze
n00b
n00b


Joined: 31 Dec 2016
Posts: 20
Location: Venezuela

PostPosted: Sun Sep 09, 2018 10:45 am    Post subject: I think is more sysvinit instead OpenRC Reply with quote

i dont use zsh. i just use bash, but the print command is available, but i dont know if work equal.

Well after analyze the initscripts of devuan, all are of sysvinit, because every script start like :

Samba
Code:
#!/bin/sh

### BEGIN INIT INFO
# Provides:          samba
# Required-Start:
# Required-Stop:
# Default-Start:
# Default-Stop:
# Short-Description: ensure Samba daemons are started (nmbd and smbd)
### END INIT INFO


for example the content of /etc/init.d/mpd is the follow :
Code:
#!/bin/sh

### BEGIN INIT INFO
# Provides:          mpd
# Required-Start:    $local_fs $remote_fs
# Required-Stop:     $local_fs $remote_fs
# Should-Start:      autofs $network $named alsa-utils pulseaudio avahi-daemon
# Should-Stop:       autofs $network $named alsa-utils pulseaudio avahi-daemon
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Music Player Daemon
# Description:       Start the Music Player Daemon (MPD) service
#                    for network access to the local audio queue.
### END INIT INFO

. /lib/lsb/init-functions

PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=mpd
DESC="Music Player Daemon"
DAEMON=/usr/bin/mpd
MPDCONF=/etc/mpd.conf

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME

if [ -n "$MPD_DEBUG" ]; then
    set -x
    MPD_OPTS=--verbose
fi

DBFILE=$(sed -n 's/^[[:space:]]*db_file[[:space:]]*"\?\([^"]*\)\"\?/\1/p' $MPDCONF)
PIDFILE=$(sed -n 's/^[[:space:]]*pid_file[[:space:]]*"\?\([^"]*\)\"\?/\1/p' $MPDCONF)

mpd_start () {
    log_daemon_msg "Starting $DESC" "$NAME"

    if [ -z "$PIDFILE" -o -z "$DBFILE" ]; then
        log_failure_msg \
            "$MPDCONF must have db_file and pid_file set; cannot start daemon."
        exit 1
    fi

    PIDDIR=$(dirname "$PIDFILE")
    if [ ! -d "$PIDDIR" ]; then
        mkdir -m 0755 $PIDDIR
        if dpkg-statoverride --list --quiet /run/mpd > /dev/null; then
            # if dpkg-statoverride is used update it with permissions there
            dpkg-statoverride --force --quiet --update --add $( dpkg-statoverride --list --quiet /run/mpd ) 2> /dev/null
        else
            # use defaults
            chown mpd:audio $PIDDIR
        fi
    fi

    start-stop-daemon --start --quiet --oknodo --pidfile "$PIDFILE" \
        --exec "$DAEMON" -- $MPD_OPTS "$MPDCONF"
    log_end_msg $?
}

mpd_stop () {
    if [ -z "$PIDFILE" ]; then
        log_failure_msg \
            "$MPDCONF must have pid_file set; cannot stop daemon."
        exit 1
    fi

    log_daemon_msg "Stopping $DESC" "$NAME"
    start-stop-daemon --stop --quiet --oknodo --retry 5 --pidfile "$PIDFILE" \
        --exec $DAEMON
    log_end_msg $?
}

# note to self: don't call the non-standard args for this in
# {post,pre}{inst,rm} scripts since users are not forced to upgrade
# /etc/init.d/mpd when mpd is updated
case "$1" in
    start)
        mpd_start
        ;;
    stop)
        mpd_stop
        ;;
    status)
       status_of_proc -p $PIDFILE $DAEMON $NAME
   ;;
    restart|force-reload)
        mpd_stop
        mpd_start
        ;;
    force-start)
        mpd_start
        ;;
    force-restart)
        mpd_stop
        mpd_start
        ;;
    force-reload)
   mpd_stop
   mpd_start
   ;;
    *)
        echo "Usage: $0 {start|stop|restart|force-reload}"
        exit 2
        ;;
esac


Because of this i think here on Devuan Jessie 1.0, the OpenRC is not full implemented. and because of that i don't make the initscript with openrc-run works fine.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Sun Sep 09, 2018 11:30 am    Post subject: Re: I think is more sysvinit instead OpenRC Reply with quote

Inukaze wrote:
i dont use zsh. i just use bash, but the print command is available, but i dont know if work equal.

Inukaze ... that will be something else, not a bash builtin:

Code:
% /bin/bash --login
$ builtin print hello
bash: builtin: print: not a shell builtin
$ builtin echo hello
hello

Inukaze wrote:
Well after analyze the initscripts of devuan, all are of sysvinit, [...]

Yes, it seems so, because the interpreter is not '/sbin/openrc-run' but '/bin/sh'.

Inukaze wrote:
Because of this i think here on Devuan Jessie 1.0, the OpenRC is not full implemented. and because of that i don't make the initscript with openrc-run works fine.

Hmmm, /etc/inittab shows it calling '/etc/init.d/rc <sysvinit_runlevel>', and unless that 'rc' is '/sbin/rc' (openrc), and those sysvinit runlevels are how devuan configured openrc runlevels (see: 'rc-status --list') then it doesn't seem like devuan is using openrc at all. In normal, or standard, operation, openrc has 'sysinit', 'boot', and 'default', runlevels (you can of course create as many as you like), and these are called (via init) like so:

/etc/inittab:
# System initialization, mount local filesystems, etc.
si::sysinit:/sbin/rc sysinit

# Further system initialization, brings up the boot runlevel.
rc::bootwait:/sbin/rc boot

l0:0:wait:/sbin/rc shutdown
l0s:0:wait:/sbin/halt -dhnp
l1:1:wait:/sbin/rc single
l2:2:wait:/sbin/rc nonetwork
l3:3:wait:/sbin/rc default
l4:4:wait:/sbin/rc default
l5:5:wait:/sbin/rc default
l6:6:wait:/sbin/rc reboot
l6r:6:wait:/sbin/reboot -dkn

Code:
# rc-status --list
shutdown
boot
sysinit
default

These include (on this host) whatever is linked from /etc/init.d/<service> to /etc/runlevels/<runlevel>/<service>

Code:
% print -rl /etc/runlevels/{sysinit,boot,default,shutdown}/*(@)
/etc/runlevels/sysinit/dmesg
/etc/runlevels/sysinit/mdev
/etc/runlevels/sysinit/sysfs
/etc/runlevels/boot/alsasound
/etc/runlevels/boot/bootmisc
/etc/runlevels/boot/fsck
/etc/runlevels/boot/hibernate-cleanup
/etc/runlevels/boot/hostname
/etc/runlevels/boot/hwclock
/etc/runlevels/boot/keymaps
/etc/runlevels/boot/localmount
/etc/runlevels/boot/loopback
/etc/runlevels/boot/modules
/etc/runlevels/boot/root
/etc/runlevels/boot/swap
/etc/runlevels/boot/sysctl
/etc/runlevels/boot/termencoding
/etc/runlevels/boot/urandom
/etc/runlevels/default/acpid
/etc/runlevels/default/fcron
/etc/runlevels/default/haveged
/etc/runlevels/default/hdparm
/etc/runlevels/default/lm_sensors
/etc/runlevels/default/local
/etc/runlevels/default/postfix
/etc/runlevels/default/syslog-ng
/etc/runlevels/shutdown/killprocs
/etc/runlevels/shutdown/mount-ro
/etc/runlevels/shutdown/savecache

So, very different from what we see from devuan.

best ... khay
Back to top
View user's profile Send private message
Inukaze
n00b
n00b


Joined: 31 Dec 2016
Posts: 20
Location: Venezuela

PostPosted: Tue Sep 11, 2018 4:37 pm    Post subject: Hi there here my outputs Reply with quote

Ok here my outputs :

/etc/inittab
Code:
# /etc/inittab: init(8) configuration.
# $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $

# The default runlevel.
id:2:initdefault:

# Boot-time system configuration/initialization script.
# This is run first except when booting in emergency (-b) mode.
##si::sysinit:/sbin/openrc sysinit      #Inukaze
##rc::bootwait:/sbin/openrc boot                #Inukaze
si::sysinit:/etc/init.d/rcS             #Default System

# What to do in single-user mode.
~~:S:wait:/sbin/sulogin

# /etc/init.d executes the S and K scripts upon change
# of runlevel.
#
# Runlevel 0 is halt.
# Runlevel 1 is single-user.
# Runlevels 2-5 are multi-user.
# Runlevel 6 is reboot.

l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6
# Normally not reached, but fallthrough in case of emergency.
z6:6:respawn:/sbin/sulogin

# What to do when CTRL-ALT-DEL is pressed.
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

# Action on special keypress (ALT-UpArrow).
#kb::kbrequest:/bin/echo "Keyboard Request--edit /etc/inittab to let this work."

# What to do when the power fails/returns.
pf::powerwait:/etc/init.d/powerfail start
pn::powerfailnow:/etc/init.d/powerfail now
po::powerokwait:/etc/init.d/powerfail stop

# /sbin/getty invocations for the runlevels.
#
# The "id" field MUST be the same as the last
# characters of the device (after "tty").
#
# Format:
#  <id>:<runlevels>:<action>:<process>
#
# Note that on most Debian systems tty7 is used by the X Window System,
# so if you want to add more getty's go ahead but skip tty7 if you run X.
#
1:2345:respawn:/sbin/getty 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
4:23:respawn:/sbin/getty 38400 tty4
5:23:respawn:/sbin/getty 38400 tty5
#6:23:respawn:/sbin/getty 38400 tty6
6:23:respawn:/sbin/getty 38400 --autologin inukaze --noclear tty6
#1:2345:respawn:/bin/login -f inukaze tty6 </dev/tty6 >/dev/tty6 2>&1

# Example how to put a getty on a serial line (for a terminal)
#
#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
#T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100

# Example how to put a getty on a modem line.
#
#T3:23:respawn:/sbin/mgetty -x0 -s 57600 ttyS3

#CS:123456:respawn:/opt/gitlab/embedded/bin/runsvdir-start


Code:
# rc-status --list
sysinit
off
boot
recovery
shutdown
default


and this line don't work for me :

Code:
print -rl /etc/runlevels/{sysinit,boot,default,shutdown}/*(@)


i don't know why start with "%" what are you using, to make that line works ?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Tue Sep 11, 2018 6:40 pm    Post subject: Re: Hi there here my outputs Reply with quote

Inukaze wrote:
/etc/inittab:
l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6

Inukaze ... yes, I saw this previously, but I have no idea what /etc/init.d/rc is, or how any of this ties in with the following (openrc) runlevels. Compare to the similar section I posted above, /sbin/rc initiates 'sysinit', 'boot', and then 'default'.

Inukaze wrote:
Code:
# rc-status --list
sysinit
off
boot
recovery
shutdown
default

Inukaze wrote:
and this line don't work for me :

Code:
print -rl /etc/runlevels/{sysinit,boot,default,shutdown}/*(@)

i don't know why start with "%" what are you using, to make that line works ?

As I said previously, 'print' is a zsh builtin ('%' is the zsh 'user' prompt). I didn't expect you to run it, because I didn't think you would have /etc/runlevels/{sysinit,boot,default,shutdown} because your inittab doesn't show you having those runlevels, and your initscripts show /bin/sh as the interpreter. Anyhow, the (non-zsh) equivelant would be:

Code:
$ find /etc/runlevels/{sysinit,boot,default,shutdown} -type l -print

best ... khay
Back to top
View user's profile Send private message
Inukaze
n00b
n00b


Joined: 31 Dec 2016
Posts: 20
Location: Venezuela

PostPosted: Tue Sep 11, 2018 11:18 pm    Post subject: Reply with quote

Ok thanks for the equivalent command, here the output :

Code:
find /etc/runlevels/{sysinit,boot,default,shutdown} -type l -print
/etc/runlevels/sysinit/mountkernfs.sh
/etc/runlevels/sysinit/udev
/etc/runlevels/sysinit/mountdevsubfs.sh
/etc/runlevels/sysinit/qemu-system-x86
/etc/runlevels/sysinit/bootlogd
/etc/runlevels/sysinit/keyboard-setup
/etc/runlevels/sysinit/hdparm
/etc/runlevels/sysinit/hostname.sh
/etc/runlevels/sysinit/hwclock.sh
/etc/runlevels/sysinit/checkroot.sh
/etc/runlevels/sysinit/checkfs.sh
/etc/runlevels/sysinit/checkroot-bootclean.sh
/etc/runlevels/sysinit/kmod
/etc/runlevels/sysinit/mountall.sh
/etc/runlevels/sysinit/mountall-bootclean.sh
/etc/runlevels/sysinit/pppd-dns
/etc/runlevels/sysinit/procps
/etc/runlevels/sysinit/resolvconf
/etc/runlevels/sysinit/udev-finish
/etc/runlevels/sysinit/urandom
/etc/runlevels/sysinit/networking
/etc/runlevels/sysinit/mountnfs.sh
/etc/runlevels/sysinit/mountnfs-bootclean.sh
/etc/runlevels/sysinit/kbd
/etc/runlevels/sysinit/console-setup
/etc/runlevels/sysinit/alsa-utils
/etc/runlevels/sysinit/bootmisc.sh
/etc/runlevels/sysinit/lm-sensors
/etc/runlevels/sysinit/virtualbox-guest-x11
/etc/runlevels/sysinit/x11-common
/etc/runlevels/sysinit/stop-bootlogd-single
/etc/runlevels/sysinit/screen-cleanup
/etc/runlevels/sysinit/ebtables
/etc/runlevels/sysinit/lvm2
/etc/runlevels/sysinit/ufw
/etc/runlevels/boot/noip2
/etc/runlevels/default/binfmt-support
/etc/runlevels/default/bootlogs
/etc/runlevels/default/minissdpd
/etc/runlevels/default/mono-xsp4
/etc/runlevels/default/motd
/etc/runlevels/default/nmbd
/etc/runlevels/default/nvidia-kernel
/etc/runlevels/default/rsyslog
/etc/runlevels/default/samba-ad-dc
/etc/runlevels/default/thinkfan
/etc/runlevels/default/timidity
/etc/runlevels/default/uuidd
/etc/runlevels/default/virtualbox
/etc/runlevels/default/virtualbox-guest-utils
/etc/runlevels/default/apache2
/etc/runlevels/default/acpid
/etc/runlevels/default/anacron
/etc/runlevels/default/atd
/etc/runlevels/default/dbus
/etc/runlevels/default/exim4
/etc/runlevels/default/gpm
/etc/runlevels/default/hddtemp
/etc/runlevels/default/irqbalance
/etc/runlevels/default/rsync
/etc/runlevels/default/smartmontools
/etc/runlevels/default/snmpd
/etc/runlevels/default/ssh
/etc/runlevels/default/winbind
/etc/runlevels/default/xinetd
/etc/runlevels/default/avahi-daemon
/etc/runlevels/default/cron
/etc/runlevels/default/mumble-server
/etc/runlevels/default/network-manager
/etc/runlevels/default/slim
/etc/runlevels/default/sshguard
/etc/runlevels/default/cups
/etc/runlevels/default/cups-browsed
/etc/runlevels/default/mpd
/etc/runlevels/default/saned
/etc/runlevels/default/smbd
/etc/runlevels/default/rc.local
/etc/runlevels/default/rmnologin
/etc/runlevels/default/stop-bootlogd
/etc/runlevels/default/nethack-common
/etc/runlevels/default/postfix
/etc/runlevels/default/vsftpd
/etc/runlevels/default/dirmngr
/etc/runlevels/default/libvirtd
/etc/runlevels/default/libvirt-guests
/etc/runlevels/default/ntp
/etc/runlevels/default/linuxlogo
/etc/runlevels/default/noip2
/etc/runlevels/shutdown/transit
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Wed Sep 12, 2018 12:29 am    Post subject: Reply with quote

Inukaze wrote:
Code:
/etc/runlevels/boot/noip2

Inukaze ... move noip2 from 'boot' to 'default'.

Code:
# rc-update del noip2 boot
# rc-update add noip2 default

I'm still not sure how devuan is connecting everything together but looking at how the runlevels are organised they are completely confused about what happens, and what stage. It seems they are using 'sysinit' for all maner of stuff (ie, networking) which should be in default, and the only thing in 'boot' is noip2 (which I assume you've added). I've no idea how they are asigning priority (and so order), as it doesn't seem that 'use', 'need', etc, is defined for initscripts ... horrible really.

They also shouldn't be using the ".sh" suffix for initscripts, as a period denotes that what follows is a 'name' (such as an interface), or runlevel.

best ... khay
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum