Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
lvm does not start because "not a valid runlevel" [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
pablo_supertux
Advocate
Advocate


Joined: 25 Jan 2004
Posts: 2931
Location: Somewhere between reality and Middle-Earth and in Freiburg (Germany)

PostPosted: Fri Jan 06, 2017 12:13 pm    Post subject: lvm does not start because "not a valid runlevel" Reply with quote

I was getting sick and tired to see the "bla bla uses runscript, please convert to openrc-run" messages, as I feared that I had to do the change myself. Anyway, I changed the init scripts from runscript to openrc and every init.d script seems to be starting and stopping properly. Only lvm fails with

Code:

# /etc/init.d/lvm start
 * /etc/init.d/lvm: not a valid runlevel


if I change it back to runscript, then the script runs normally.

What does "not a valid runlevel" mean? I've found this thread but it seems that my problem is unrelated, my /etc/runlevels/ looks fine. I even inspected the source code of openrc (src/librc/librc.c

Code:

bool
rc_runlevel_exists(const char *runlevel)
{
    char path[PATH_MAX];
    struct stat buf;

    if (!runlevel || strcmp(runlevel, ".") == 0 || strcmp(runlevel, "..") == 0)
        return false;
    snprintf(path, sizeof(path), "%s/%s", RC_RUNLEVELDIR, runlevel);
    if (stat(path, &buf) == 0 && S_ISDIR(buf.st_mode))
        return true;
    return false;
}
librc_hidden_def(rc_runlevel_exists)


and as far as I can tell, RC_RUNLEVELDIR is /etc/runlevels and /etc/runlevels/boot/ exists and is a directory, so I don't understand why this function is returning false with the lvm script.
_________________
A! Elbereth Gilthoniel!
silivren penna míriel
o menel aglar elenath,
Gilthoniel, A! Elbereth!


Last edited by pablo_supertux on Fri Jan 06, 2017 3:49 pm; edited 1 time in total
Back to top
View user's profile Send private message
Apheus
Guru
Guru


Joined: 12 Jul 2008
Posts: 422

PostPosted: Fri Jan 06, 2017 12:41 pm    Post subject: Re: lvm does not start because "not a valid runlevel&qu Reply with quote

pablo_supertux wrote:
Anyway, I changed the init scripts from runscript to openrc


Is that a typo in the forum or a typo in the init scripts? It must be "openrc-run".

Reemerge of the affected packages should take care of the issue. The current versions are changed, but without revbump. If you are on stable, udev is an exception.
_________________
My phrenologist says I'm stupid.
Back to top
View user's profile Send private message
pablo_supertux
Advocate
Advocate


Joined: 25 Jan 2004
Posts: 2931
Location: Somewhere between reality and Middle-Earth and in Freiburg (Germany)

PostPosted: Fri Jan 06, 2017 3:48 pm    Post subject: Reply with quote

Hi Apheus, it wasn't a typo, I really had /sbin/openrc and not /sbin/openrc-run. That solved it.
_________________
A! Elbereth Gilthoniel!
silivren penna míriel
o menel aglar elenath,
Gilthoniel, A! Elbereth!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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