Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 70131 - sys-apps/openrc: RFE: init.d net.* config file verification
Summary: sys-apps/openrc: RFE: init.d net.* config file verification
Status: CONFIRMED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All All
: High enhancement (vote)
Assignee: OpenRC Team
URL:
Whiteboard: openrc:oldnet
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-04 21:57 UTC by SpanKY
Modified: 2013-04-25 23:08 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description SpanKY gentoo-dev 2004-11-04 21:57:30 UTC
with the new net scripts, configuration can be a little confusing ...

one wrong thing and the interface would fall back to dhcp (which wont work in some networks) ... and the only real way to test the init scripts atm is to actually bring them down and then back up ...
with remote boxes you're basically left going 'crap crap i hope it works'

so, i wish i could simply do:
/etc/init.d/net.eth0 checkconfig

the scripts would do everything normally except for actually bring up the interface ... example output would be like:
# /etc/init.d/net.eth1 checkconfig
 * Checking config for eth1
 *    Bringing up eth1
 *       Configuration not set for eth1 - assuming dhcp
 *       eth1 dhcp
 *          !exec cmd: dhcpcd eth1!                        [ ok ]

instead of actually running the command, the net scripts would output the command exactly as it would be run
Comment 1 MAL 2006-08-06 13:45:02 UTC
Has this been lost in the mists of time? :)

I'd love this functionality.
Comment 2 Roy Marples (RETIRED) gentoo-dev 2006-08-08 02:32:09 UTC
(In reply to comment #1)
> Has this been lost in the mists of time? :)
> 
> I'd love this functionality.

No, it's constantly on my bug list.
However, it's probably the lowest priority bug I have and also the most difficult. Why is it difficult? Well, modules like arping, iwconfig and wpa_supplicant can change the config based on what they find and in the case of arping the interface needs to be in a certain state - although we may be able to work around that. Also wpa_supplicant is re-entrant which means we only know the config we're going to apply the second time we are called.

Care to write me a patch? :)
Comment 3 William Hubbs gentoo-dev 2009-12-06 17:04:46 UTC
All,

are we still interested in this functionality?

Thanks,

William
Comment 4 Dennis Schridde 2009-12-06 17:27:22 UTC
Yes, I think so. At least outputting the commands to be run would be helpful already, if that is possible. And the new init.d/network seems a bit simpler than the old net.*, so maybe checkconfig can be implemented for that one?
Comment 5 SpanKY gentoo-dev 2009-12-07 09:10:10 UTC
yes, this feature is still wanted
Comment 6 Roy Marples 2009-12-07 12:50:43 UTC
(In reply to comment #4)
> Yes, I think so. At least outputting the commands to be run would be helpful
> already, if that is possible.

We can do that.

> And the new init.d/network seems a bit simpler
> than the old net.*, so maybe checkconfig can be implemented for that one?

No not really. At most you could check for syntax issues as it cannot read your mind to check that the static address you have configured is on slightly the wrong subnet to actually work.
Comment 7 Dennis Schridde 2009-12-07 15:16:46 UTC
(In reply to comment #6)
> (In reply to comment #4)
> > And the new init.d/network seems a bit simpler
> > than the old net.*, so maybe checkconfig can be implemented for that one?
> 
> No not really. At most you could check for syntax issues as it cannot read your
> mind to check that the static address you have configured is on slightly the
> wrong subnet to actually work.
Of course you cannot check that. I just assumed since the configuration is less complex, that it might be easier to implement checkconfig for newnet than for oldnet. Just in case your resources are too limited for both.
Comment 8 Benda Xu gentoo-dev 2012-06-07 03:54:32 UTC
I'd like this feature too. Is there anyone who is working on this?

to output the actual command without executing, it seems that we need to hack the interpreter.

Luca(adding to Cc) had an idea to use customized busybox to realize extra features not suitable for /bin/sh. I feel it applies to this checkconfig.
Comment 9 William Hubbs gentoo-dev 2012-06-07 04:30:39 UTC
(In reply to comment #8)
> I'd like this feature too. Is there anyone who is working on this?
> 
> to output the actual command without executing, it seems that we need to
> hack the interpreter.

No, there wouldn't need to be a hack to the shell to do this. We would just need to be able to have some way to print the commands to run instead of actually running them.

> 
> Luca(adding to Cc) had an idea to use customized busybox to realize extra
> features not suitable for /bin/sh. I feel it applies to this checkconfig.

Remember that openrc is required to run on posix-compatible shells, so we can't require busybox here.