You are not logged in.

#1 2010-07-15 05:28:19

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

[SOLVED]Running a script before starting the network daemon

I want to run a script, which requires root permissions before starting the network daemon.
How would I go about achieving that? I know the commands, but I need to do this before starting network in my DAEMONS array.

Can I just create a daemon script and add it to the DAEMONS array before starting @network?

How would I give it root access? via sudoers?

Last edited by Inxsible (2010-07-15 19:29:18)


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#2 2010-07-15 05:33:32

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED]Running a script before starting the network daemon

DAEMONS=( ... !network ...)
Run your script, start the network.

Offline

#3 2010-07-15 05:38:58

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: [SOLVED]Running a script before starting the network daemon

karol wrote:

DAEMONS=( ... !network ...)
Run your script, start the network.

you mean start the network in the script itself? That could possibly work. Let me try it out.

I want this for all users of the system, so I guess I can place the script in the /etc/rc.d folder?


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#4 2010-07-15 05:40:56

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED]Running a script before starting the network daemon

> I want this for all users of the system, so I guess I can place the script in the /etc/rc.d folder?
Somewhere in  /etc for sure :-)

Offline

#5 2010-07-15 05:43:37

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED]Running a script before starting the network daemon

Or use netcfg, which supports exactly what you want.

Offline

#6 2010-07-15 06:00:25

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: [SOLVED]Running a script before starting the network daemon

tomk wrote:

Or use netcfg, which supports exactly what you want.

Off to man netcfg / wiki: netcfg

Last edited by Inxsible (2010-07-15 06:09:42)


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#7 2010-07-15 06:28:31

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: [SOLVED]Running a script before starting the network daemon

I read the wiki for netcfg and I was a little confused between
net-profiles -- which starts up the profiles on boot and
net-auto-wired -- which automatically connects to wired networks.

How are they different? And if they are different, do I need to have both in my DAEMONS array?

Last edited by Inxsible (2010-07-15 06:39:30)


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#8 2010-07-15 06:40:39

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: [SOLVED]Running a script before starting the network daemon

Ok. I have created a profile and everything works except that I get this message/error

╔═[02:38]═[murtuza @ wolfdale]
╚═══===═══[/etc/network.d]>> sudo netcfg eth0-dhcp 
:: eth0-dhcp up                                                                                                                [BUSY] 
find: `/var/run/network//suspend/': No such file or directory                                                                  [DONE]

What does that mean?

Last edited by Inxsible (2010-07-15 06:41:54)


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#9 2010-07-15 19:21:50

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: [SOLVED]Running a script before starting the network daemon

Inxsible wrote:

Ok. I have created a profile and everything works except that I get this message/error

╔═[02:38]═[murtuza @ wolfdale]
╚═══===═══[/etc/network.d]>> sudo netcfg eth0-dhcp 
:: eth0-dhcp up                                                                                                                [BUSY] 
find: `/var/run/network//suspend/': No such file or directory                                                                  [DONE]

What does that mean?

http://bbs.archlinux.org/viewtopic.php?id=91461&p=1
http://bugs.archlinux.org/task/18443?

It seems to be a netcfg bug.

Last edited by cesura (2010-07-15 19:24:45)

Offline

#10 2010-07-15 19:29:02

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: [SOLVED]Running a script before starting the network daemon

Thanks brad. In that case, this thread be SOLVED


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

Board footer

Powered by FluxBB