Search:  
Gentoo Wiki

TIP_Vary_Configuration_Files_Based_on_Softlevel

This article is part of the Tips & Tricks series.
Terminals / Shells Network X Window System Portage System Filesystems Kernel Other

Contents

Vary Configuration Files Based on Softlevel

Introduction

Sometimes you may want to use the same /etc/init.d/ startup services in multiple softlevels but vary the precise configuration depending on the softlevel.

Method

You can do this by creating a new alternate configuration file in /etc/conf.d using the syntax <service>.<runlevel>.

Example

As an example, I have three alternate conf.d files for my firehol firewall, /etc/init.d/firehol (which starts in default) and /etc/conf.d/firehol.dialup and /etc/conf.d/firehol.sprint, which will start in dialup and sprint respectively.

I also have two different net.ppp0 files, one for dialup service and the other for my wireless modem, /etc/conf.d/net.ppp0.dialup and /etc/conf.d/net.ppp0.sprint.

Troubleshooting

  • How do i make choose the alternative config at boot?

Append:

softlevel=new-runlevel
  • My machine boots and complains about missing runlevel. how do i fix this?
# cd /etc/runlevels
# mkdir new-runlevel
  • My machine only boots to runlevel 3 now... how do i fix this?

See Also


Last modified: Fri, 05 Sep 2008 08:46:00 +0000 Hits: 6,979