Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
writing runscripts and getting their boot order working
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
botman
n00b
n00b


Joined: 25 Apr 2004
Posts: 10
Location: Indiana, US

PostPosted: Wed Jun 15, 2005 9:04 pm    Post subject: writing runscripts and getting their boot order working Reply with quote

hey,

I've got a boot script that i've written and put into /etc/init.d/. it's called lpart. Basically I want it to run as early as possible because it automatically partitions the hard drive using sfdisk. In the depend{} section of script I have 'before X' where X is just about every boot service that I could think of and i used 'rc-update add lpart boot' to get it to start on boot. However, for some strange reason, lpart isn't actually executed until after modules are loaded and such. I'm stumped as to why the depend{} stuff isn't working as it should be.

thanks for any help,
andrew

edit:
currently i just have it as 'need localmount' so that before any partitions are mounted locally, the hard drive is partitioned.
Back to top
View user's profile Send private message
alkan
Guru
Guru


Joined: 06 Aug 2004
Posts: 385
Location: kasimlar yaylasi

PostPosted: Thu Jun 16, 2005 7:26 am    Post subject: Reply with quote

I believe the first servie is the checkroot, did you try "before checkroot" or "before *"
Back to top
View user's profile Send private message
botman
n00b
n00b


Joined: 25 Apr 2004
Posts: 10
Location: Indiana, US

PostPosted: Thu Jun 16, 2005 1:17 pm    Post subject: Reply with quote

yes, i tried both of those, neither one works. The dependancy structure is correct, but it's not executing them in the right order to satisfy the given dependancies. The only thing in the depend{} now is before checkroot.
Back to top
View user's profile Send private message
alkan
Guru
Guru


Joined: 06 Aug 2004
Posts: 385
Location: kasimlar yaylasi

PostPosted: Thu Jun 16, 2005 9:33 pm    Post subject: Reply with quote

I doubt it, but may be RC_PARALLEL_STARTUP="yes" in your /etc/conf.d/rc. Try setting it to RC_PARALLEL_STARTUP="no".
Back to top
View user's profile Send private message
botman
n00b
n00b


Joined: 25 Apr 2004
Posts: 10
Location: Indiana, US

PostPosted: Fri Jun 17, 2005 7:50 pm    Post subject: Reply with quote

I've checked my /etc/conf.d/rc and parallel scripts is disabled, so that's not the problem. Does any one know why these init scripts aren't running in the correct order? This problem is starting to drive me insane, because all the documentation I've read indicates that my setup should insure that my script, lpart, should run before the other boot scripts.
Back to top
View user's profile Send private message
alkan
Guru
Guru


Joined: 06 Aug 2004
Posts: 385
Location: kasimlar yaylasi

PostPosted: Fri Jun 17, 2005 9:26 pm    Post subject: Reply with quote

can you post all the RC_DEPEND_TREE[X] groups that your script mentioned in the /var/lib/init.d/deptree?
Back to top
View user's profile Send private message
botman
n00b
n00b


Joined: 25 Apr 2004
Posts: 10
Location: Indiana, US

PostPosted: Wed Jun 22, 2005 6:37 pm    Post subject: Reply with quote

thanks for the response. here's my RC_DEPEND_TREE[X] for lpart, my additional script, checkroot, and a few other pertinant looking things:

Code:
rc_type_ineed=2
rc_type_needsme=3
rc_type_iuse=4
rc_type_usesme=5
rc_type_ibefore=6
rc_type_iafter=7
rc_type_broken=8
rc_type_parallel=9
rc_type_mtime=10
rc_index_scale=11

declare -a RC_DEPEND_TREE

RC_DEPEND_TREE[0]=43

RC_DEPEND_TREE[198]="checkfs"
RC_DEPEND_TREE[198+2]="checkroot modules"
RC_DEPEND_TREE[198+3]="localmount"
RC_DEPEND_TREE[198+4]=
RC_DEPEND_TREE[198+5]=
RC_DEPEND_TREE[198+6]="local"
RC_DEPEND_TREE[198+7]=
RC_DEPEND_TREE[198+8]=
RC_DEPEND_TREE[198+9]=
RC_DEPEND_TREE[198+10]="1098917125"

RC_DEPEND_TREE[209]="checkroot"
RC_DEPEND_TREE[209+2]="lpart"
RC_DEPEND_TREE[209+3]="checkfs crypto-loop domainname hostname modules"
RC_DEPEND_TREE[209+4]=
RC_DEPEND_TREE[209+5]=
RC_DEPEND_TREE[209+6]="local"
RC_DEPEND_TREE[209+7]="lpart"
RC_DEPEND_TREE[209+8]=
RC_DEPEND_TREE[209+9]=
RC_DEPEND_TREE[209+10]="1119378684"

RC_DEPEND_TREE[275]="lpart"
RC_DEPEND_TREE[275+2]=
RC_DEPEND_TREE[275+3]="checkroot"
RC_DEPEND_TREE[275+4]=
RC_DEPEND_TREE[275+5]=
RC_DEPEND_TREE[275+6]="checkroot local localmount"
RC_DEPEND_TREE[275+7]=
RC_DEPEND_TREE[275+8]=
RC_DEPEND_TREE[275+9]=
RC_DEPEND_TREE[275+10]="1119378548"

RC_GOT_DEPTREE_INFO="yes"

LOGGER_SERVICE="syslog-ng"
Back to top
View user's profile Send private message
alkan
Guru
Guru


Joined: 06 Aug 2004
Posts: 385
Location: kasimlar yaylasi

PostPosted: Wed Jun 22, 2005 7:14 pm    Post subject: Reply with quote

AFAIK that looks ok to me. It says lpart should start before checkroot. The only strange thing that it says checkroot needs lpart, you must have added that manually into checkroot script. But that shouldn't matter. Sorry your problem must be something else.
Back to top
View user's profile Send private message
botman
n00b
n00b


Joined: 25 Apr 2004
Posts: 10
Location: Indiana, US

PostPosted: Wed Jun 22, 2005 8:14 pm    Post subject: Reply with quote

yes, I had to change checkroot from depend * to simply need lpart
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo 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