Linux Debian support - Where to put the startup stuff?

This is Interesting: Free IT Magazines  
Home > Archive > Linux Debian support > October 2005 > Where to put the startup stuff?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Where to put the startup stuff?
Niki Kovacs

2005-10-03, 5:52 pm

Hi,

I'm a long-time Slackware user currently giving Debian a try... and I like
it! And it's well documented!

One thing puzzles me. One of the big differences is handling of startup. Now
I wonder where to put the stuff that I used to put in /etc/rc.d/rc.M,
or /etc/rc.d/rc.local. Would that be /etc/init.d/bootmisc.sh?

More concretely, here's the things I want to do:

1) On one machine I have two ethernet cards that used to be "linked" by a
bridge with bridge-utils. The two cards were not defined in terms of IP
(both 0.0.0.0), but the IP was assigned to the (virtual) interface br0.
Question: where do I put the definition of that bridge? (used to be in
rc.local)

2) my HP printer works with hpoj, via a daemon /usr/sbin/ptal-init. This
daemon has to be launched on startup, but *before* CUPS. (On my Slack box,
I used to add a stanza in /etc/rc.d/rc.M, right before the CUPS stanza).
Question 2: where do I put the command to launch /usr/sbin/ptal-init?

3) I'm on dialup here, and we share a connection via the linesrv connection
manager. To activate IP masquerading, I had a two-liner
in /etc/rc.d/rc.firewall, and IP forwarding was activated
with /etc/rc.d/rc.ip_forward. Question 3: how are things done properly the
Debian way for IP masquerading.

Cheers,

Niki Kovacs
--
I'm not as think as you stoned I am.
Ole-Morten Duesund

2005-10-03, 5:52 pm

On 2005-10-03, Niki Kovacs <mickey@mouse.com> wrote:
> Hi,
>
> I'm a long-time Slackware user currently giving Debian a try... and I like
> it! And it's well documented!
>
> One thing puzzles me. One of the big differences is handling of startup. Now
> I wonder where to put the stuff that I used to put in /etc/rc.d/rc.M,
> or /etc/rc.d/rc.local. Would that be /etc/init.d/bootmisc.sh?
>
> More concretely, here's the things I want to do:
>
> 1) On one machine I have two ethernet cards that used to be "linked" by a
> bridge with bridge-utils. The two cards were not defined in terms of IP
> (both 0.0.0.0), but the IP was assigned to the (virtual) interface br0.
> Question: where do I put the definition of that bridge? (used to be in
> rc.local)

That would be in /etc/network/interfaces - it has a very good man-page
that should help you get the bridge up and running.

> 2) my HP printer works with hpoj, via a daemon /usr/sbin/ptal-init. This
> daemon has to be launched on startup, but *before* CUPS. (On my Slack box,
> I used to add a stanza in /etc/rc.d/rc.M, right before the CUPS stanza).
> Question 2: where do I put the command to launch /usr/sbin/ptal-init?

Install the debian-package "hpoj" - it will take care of init-scripts in
/etc/init.d (and links in /etc/rc*.d

> 3) I'm on dialup here, and we share a connection via the linesrv connection
> manager. To activate IP masquerading, I had a two-liner
> in /etc/rc.d/rc.firewall, and IP forwarding was activated
> with /etc/rc.d/rc.ip_forward. Question 3: how are things done properly the
> Debian way for IP masquerading.


You could install systune and in /etc/systune.conf set
/proc/sys/net/ipv4/ip_forward:1

And, for the very simple masquerading solution - manually type in
whatever you had in your rc.firewall script, then do:
/etc/init.d/iptables save active

This will save the active iptables configuration and automatically
restore it after reboots.
Alternatively you can save it under a different name and do :
/etc/init.d/iptables restore <whatevernameyouchoose>

to manually set the masquerading.

A different way (and probably more sequre) would be to install one of
the many firewall packages from debian.
$ apt-cache search firewall

should give you a "few" startingpoints.

HTH,
--
Ole-Morten Duesund
http://glemt.net/
Niki Kovacs

2005-10-04, 5:48 pm

Ole-Morten Duesund wrote:

> That would be in /etc/network/interfaces - it has a very good man-page
> that should help you get the bridge up and running.


Yeah. I took a peek in /usr/share/doc/bridge-utils, and there's a way indeed
to configure a bridge directly in /etc/network/interfaces. Works nice.

However, a new problem (small, though) has arisen. The PC won't shutdown
properly. It does, if I issue 'ifdown br0' manually before 'shutdown -h
now'. I guess I have to add it to some shutdown script now. Where?

Niki Kovacs
--
I'm not as think as you stoned I am.
Niki Kovacs

2005-10-04, 5:48 pm

Ole-Morten Duesund wrote:

>


<snip>

>
> A different way (and probably more sequre) would be to install one of
> the many firewall packages from debian.
> $ apt-cache search firewall


I did that, and among the many things I found, ipmasq was just the thing I
needed. apt-get install ipmasq automagically set me up IP masquerading in
no time. Thanks, that helped!

Niki Kovacs
--
I'm not as think as you stoned I am.
Ole-Morten Duesund

2005-10-04, 5:48 pm

On 2005-10-04, Niki Kovacs <mickey@mouse.com> wrote:
> Ole-Morten Duesund wrote:
>
>
> Yeah. I took a peek in /usr/share/doc/bridge-utils, and there's a way indeed
> to configure a bridge directly in /etc/network/interfaces. Works nice.
>
> However, a new problem (small, though) has arisen. The PC won't shutdown
> properly. It does, if I issue 'ifdown br0' manually before 'shutdown -h
> now'. I guess I have to add it to some shutdown script now. Where?


Strange, it should "just work" - do you have any errormessages (from
/var/log/[syslog|messages]) ?

--
Ole-Morten Duesund
http://glemt.net/
Niki Kovacs

2005-10-05, 2:46 am

Ole-Morten Duesund wrote:

>
> Strange, it should "just work" - do you have any errormessages (from
> /var/log/[syslog|messages]) ?


Well, that's a chicken-and-egg problem. Since it's one of the last things
the PC does before shutting down for good, I can't really read any log
files.

NK
--
I'm not as think as you stoned I am.
Ole-Morten Duesund

2005-10-05, 7:46 am

On 2005-10-05, Niki Kovacs <mickey@mouse.com> wrote:
> Ole-Morten Duesund wrote:
>
>
> Well, that's a chicken-and-egg problem. Since it's one of the last things
> the PC does before shutting down for good, I can't really read any log
> files.


The chicken came first!
Any errormessages to the console then? Or anything in the log-files
after a (forced?) reboot?

How does the br0 setup in /etc/network/interfaces look?

--
Ole-Morten Duesund
http://glemt.net/
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com