From: Wang Jian <lark@linux.net.cn>
To: netfilter-devel@lists.netfilter.org
Subject: new REBOOT target
Date: Sat, 26 Feb 2005 22:30:47 +0800 [thread overview]
Message-ID: <20050226215628.C7D1.LARK@linux.net.cn> (raw)
[-- Attachment #1: Type: text/plain, Size: 1711 bytes --]
Hi,
For my own purpose, I write a REBOOT target to remotely reboot a linux
box using specially crafted ICMP packet.
One of my servers has symptom that httpd locks machine:
1. console is locked, not usable;
2. network seems to be good, ICMP echo/reply is ok; tcp connection can
be established on open ports, but userspace server programs seem to
be out of luck;
3. if keep it as it for quite a long time, network dies but console
works again;
The server is hosted in a remote small data center, and it is not
possible to get there everytime it is locked.
That is the scenario this REBOOT target fits. I am interested in other
usage if someone else can find. I post it here in case it is also useful
for others.
Usage:
# iptables -I INPUT -p icmp -j REBOOT --passphrase pass [--offset offset]
[--hard (0|1)]
A perl script is used to send special ICMP packet.
All files are in attached tarball.
Some notes on the source code:
1. There are hardcode paths in Makefile, so some modification is needed
to compile;
2. The code is for iptables 1.2.9;
3. --passphrase is mandatory. There is string matching functionality in
ipt_string, however ipt_string is not standard module, and missing in
many distributions' kernel. So I write my own matching code. If
ipt_string becomes standard, then this parameter can be eliminated along
with --offset.
4. reboot code is ugly. I want it to support a more safe reboot, such as
sync() then sys_reboot(), but sys_reboot() need a userspace pointer,
cannot be called directly from kernel.
5. There is a reserved 'count' which can be used to do
trigger-n-times-then-do-it control.
Any feedback and suggestion is welcome :)
--
lark
[-- Attachment #2: nfreboot-0.1.tar.gz --]
[-- Type: application/octet-stream, Size: 3809 bytes --]
next reply other threads:[~2005-02-26 14:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-26 14:30 Wang Jian [this message]
2005-02-28 9:06 ` new REBOOT target Max Kellermann
2005-02-28 9:41 ` Re[2]: " Wang Jian
2005-03-01 0:20 ` Max Kellermann
2005-03-01 5:14 ` Re[2]: " Wang Jian
2005-03-01 8:22 ` Andrew Kozachenko
2005-03-01 9:49 ` Re[2]: " Wang Jian
2005-03-01 2:39 ` Tobias DiPasquale
2005-03-01 5:10 ` Re[2]: " Wang Jian
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050226215628.C7D1.LARK@linux.net.cn \
--to=lark@linux.net.cn \
--cc=netfilter-devel@lists.netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.