Hallo,
eine Frage zum Start von Debian Sarge.
In welcher Datei finde ich die Starts von den Daemons, die bei mir laufen? Z.B. will ich, dass der sshd nicht startet und dass samba immer startet.
Es geht mir nicht ums installieren. Ich will bloß vermeiden nach jedem Start mit /etc/init.d/... start-stop die Daemons manuell zu starten/stoppen.
Vielen Dank für die Hilfe.
Gruß,
blue32
Seite 1 von 1
Daemons (nicht) Starten
#1
geschrieben 30. Juli 2005 - 09:35
These guys are the best surfers in the world.
No surfboard, no wetsuit, no worries.
Phil, speaking about dolphins
No surfboard, no wetsuit, no worries.
Phil, speaking about dolphins
Anzeige
#2
geschrieben 30. Juli 2005 - 12:54
Einfach die exec-Rechte der rc.sshd entfernen
Oder im startup/init-skript die entsprechende(n) Zeile(n) entfernen.
Und Samba kannst du über den inetd regeln, also einfach die entsprechenden Zeilen in der inetd.conf aktivieren (Kommentarzeichen entfernen):
Bleistift:
netbios-ssn stream tcp nowait root /usr/sbin/smbd smbd
netbios-ns dgram udp wait root /usr/sbin/nmbd nmbd
#und evtl noch SWAT
swat stream tcp nowait.400 root /usr/sbin/swat swat
Alternativ kannst du auch einfach die rc.samba mit exec-Rechten ausstatten.
Oder im startup/init-skript die entsprechende(n) Zeile(n) entfernen.
Und Samba kannst du über den inetd regeln, also einfach die entsprechenden Zeilen in der inetd.conf aktivieren (Kommentarzeichen entfernen):
Bleistift:
netbios-ssn stream tcp nowait root /usr/sbin/smbd smbd
netbios-ns dgram udp wait root /usr/sbin/nmbd nmbd
#und evtl noch SWAT
swat stream tcp nowait.400 root /usr/sbin/swat swat
Alternativ kannst du auch einfach die rc.samba mit exec-Rechten ausstatten.
Dieser Beitrag wurde von puppet bearbeitet: 30. Juli 2005 - 13:17
#3
geschrieben 30. Juli 2005 - 14:38
Also die Sache mit den Execute-Rechten würde ich lieber lassen!
Schau erstmal in der /etc/inittab nach, welches Runlevel du als Default hast. Dann wechselst du in das Verzeichniss /etc/rcX.d/ (X je nach Nummer des Default Runlevels). In dem Verzeichniss gibt es Verknüpfungen auf die Initskripte, welche in dem Runlevel gestartet werden soll. Verknüpfungen mit einem "S" vorne bedeuten "Start", die mit "K" bedeuten "Kill". Die Nummern dannach geben die Reihenfolge an. Nach dem "S"/"K" und der Nummer folgt dann die Bezeichnung. Wenn du jetzt also den SSHd nicht starten lassen willst, löscht du einfach die Verknüpfung mit einem "S" vorne und eben "sshd" als Bezeichnung. Und anders herum kannst du auf das Initskript für Samba (Initskripte liegen in /etc/init.d/) eine Verknüpfung nach dem Schema "S"NummerBezeichnung machen und dann wird Samba automatisch gestartet.
Schau erstmal in der /etc/inittab nach, welches Runlevel du als Default hast. Dann wechselst du in das Verzeichniss /etc/rcX.d/ (X je nach Nummer des Default Runlevels). In dem Verzeichniss gibt es Verknüpfungen auf die Initskripte, welche in dem Runlevel gestartet werden soll. Verknüpfungen mit einem "S" vorne bedeuten "Start", die mit "K" bedeuten "Kill". Die Nummern dannach geben die Reihenfolge an. Nach dem "S"/"K" und der Nummer folgt dann die Bezeichnung. Wenn du jetzt also den SSHd nicht starten lassen willst, löscht du einfach die Verknüpfung mit einem "S" vorne und eben "sshd" als Bezeichnung. Und anders herum kannst du auf das Initskript für Samba (Initskripte liegen in /etc/init.d/) eine Verknüpfung nach dem Schema "S"NummerBezeichnung machen und dann wird Samba automatisch gestartet.
#4
geschrieben 30. Juli 2005 - 14:57
Zitat (AlienSearcher: 30.07.2005, 15:38)
Also die Sache mit den Execute-Rechten würde ich lieber lassen!
rc.samba sagte:
# To make Samba start automatically at boot, make this
# file executable: chmod 755 /etc/rc.d/rc.samba
# file executable: chmod 755 /etc/rc.d/rc.samba
Zitat (AlienSearcher: 30.07.2005, 15:38)
Schau erstmal in der /etc/inittab nach, welches Runlevel du als Default hast. Dann wechselst du in das Verzeichniss /etc/rcX.d/ (X je nach Nummer des Default Runlevels). In dem Verzeichniss gibt es Verknüpfungen auf die Initskripte, welche in dem Runlevel gestartet werden soll. Verknüpfungen mit einem "S" vorne bedeuten "Start", die mit "K" bedeuten "Kill". Die Nummern dannach geben die Reihenfolge an. Nach dem "S"/"K" und der Nummer folgt dann die Bezeichnung. Wenn du jetzt also den SSHd nicht starten lassen willst, löscht du einfach die Verknüpfung mit einem "S" vorne und eben "sshd" als Bezeichnung. Und anders herum kannst du auf das Initskript für Samba (Initskripte liegen in /etc/init.d/) eine Verknüpfung nach dem Schema "S"NummerBezeichnung machen und dann wird Samba automatisch gestartet.
Das heißt Init-Skript und nicht Init-Link.
Und wie schon erwähnt ist Samba ein Teil des inetd, lässt sich also ohne Probleme auch darüber konifgurieren.
Übrigens ist das rc.S nicht dafür um Remote-Zugriff Daemons zu starten sondern um das System zu initialisieren (FS mounten, Swap aktivieren, Kernelmodule laden usw), für Multi-User (z.B. SSHd und Samba) gibt es das rc.M, und K steht schon nicht für Kill, sondern für den admin-state/single-user (rl 1).
#5
geschrieben 30. Juli 2005 - 15:09
1. Dem Init-Skript die Execute-Rechte zu entziehen, ist in keinster Weise im Sinne des System V, sondern viel mehr eine Quick&Dirty-Lösung
2. Das "S" und "K" _ist_ Start, bzw Kill
3. Wenn Samba ein Teil des initd ist, schön, dann soll er so konfiguriert werden. Wenn er es aber nicht wäre, wäre meine Lösung die richtige
4. Dateisysteme mounten, Swap aktivieren und Kernelmodule laden wird auf keinen Fall über die Initskripte realisiert.
5. Solltest du mal Lesen anfangen. Ich denke, da hast du noch was nachzuholen. Ist jetzt nicht böse gemeint Ich empfehle dir "UNIX Systemadministration" oder eine gute Vorlesung an deiner Hochschule...
2. Das "S" und "K" _ist_ Start, bzw Kill
3. Wenn Samba ein Teil des initd ist, schön, dann soll er so konfiguriert werden. Wenn er es aber nicht wäre, wäre meine Lösung die richtige
4. Dateisysteme mounten, Swap aktivieren und Kernelmodule laden wird auf keinen Fall über die Initskripte realisiert.
5. Solltest du mal Lesen anfangen. Ich denke, da hast du noch was nachzuholen. Ist jetzt nicht böse gemeint Ich empfehle dir "UNIX Systemadministration" oder eine gute Vorlesung an deiner Hochschule...
#6
geschrieben 30. Juli 2005 - 15:24
Meine Hochschule?
Sorry aber Debian hat wohl nicht mehr sehr viel mit SysV gemeinsam, siehe daran das rl 2 schon networked text ist, wobei es bei den meisten *NIX (wie auch SysV) erst rl 3 ist.
Und das rc.S dient wohl zur System Init:Und genau dort werden auch die FS gemountet:Den SSHd über rc.S starten zu lassen dürfte sowieso fehlschalgen, da beim rc.S noch kein Netzwerk initialisiert wurde (dies passiert bei SysV im rl3, bei Debian wohl schon im rl2).
Außerdem sagte ich nicht dem Init-Skript das exec entziehen sondern dem rc.sshd, vllt solltest du mal mit lesen anfangen, der Satz "Wenn Samba ein Teil des initd ist" zeugt wohl davon das du nicht gelesen hast (oder nicht weisst das inetd und (SysV)init ganz unterschiedliche Sachen sind).
Sorry aber Debian hat wohl nicht mehr sehr viel mit SysV gemeinsam, siehe daran das rl 2 schon networked text ist, wobei es bei den meisten *NIX (wie auch SysV) erst rl 3 ist.
Und das rc.S dient wohl zur System Init:
rc.S sagte:
#!/bin/sh
#
# /etc/rc.d/rc.S: System initialization script.
#
#
# /etc/rc.d/rc.S: System initialization script.
#
rc.S sagte:
# Start devfsd if necessary. On newer kernels, udev should be used instead.
if [ -x /etc/rc.d/rc.devfsd ]; then
/etc/rc.d/rc.devfsd start
fi
# Mount sysfs next, if the kernel supports it:
if [ -d /sys ]; then
if cat /proc/filesystems | grep -w sysfs 1> /dev/null 2> /dev/null ; then
if ! cat /proc/mounts | grep -w sysfs 1> /dev/null 2> /dev/null ; then
/sbin/mount -v sysfs /sys -n -t sysfs
fi
fi
fi
# Initialize udev to manage /dev entries for 2.6.x kernels:
if [ -x /etc/rc.d/rc.udev ]; then
if ! grep -w nohotplug /proc/cmdline 1> /dev/null 2> /dev/null ; then
/etc/rc.d/rc.udev
fi
fi
# Enable swapping:
/sbin/swapon -a
# Test to see if the root partition is read-only, like it ought to be.
READWRITE=no
if touch /fsrwtestfile 2>/dev/null; then
rm -f /fsrwtestfile
READWRITE=yes
else
echo "Testing root filesystem status: read-only filesystem"
fi
# See if a forced filesystem check was requested at shutdown:
if [ -r /etc/forcefsck ]; then
FORCEFSCK="-f"
fi
# Check the root filesystem:
if [ ! $READWRITE = yes ]; then
RETVAL=0
if [ ! -r /etc/fastboot ]; then
echo "Checking root filesystem:"
/sbin/fsck $FORCEFSCK -C -a /
RETVAL=$?
fi
# An error code of 2 or higher will require a reboot.
if [ $RETVAL -ge 2 ]; then
# An error code equal to or greater than 4 means that some errors
# could not be corrected. This requires manual attention, so we
# offer a chance to try to fix the problem in single-user mode:
if [ $RETVAL -ge 4 ]; then
echo
echo "*********************************************
**************"
echo "*** An error occurred during the root filesystem check. ***"
echo "*** You will now be given a chance to log into the ***"
echo "*** system in single-user mode to fix the problem. ***"
echo "*** ***"
echo "*** If you are using the ext2 filesystem, running ***"
echo "*** 'e2fsck -v -y <partition>' might help. ***"
echo "*********************************************
**************"
echo
echo "Once you exit the single-user shell, the system will reboot."
echo
PS1="(Repair filesystem) \#"; export PS1
sulogin
else # With an error code of 2 or 3, reboot the machine automatically:
echo
echo "***********************************"
echo "*** The filesystem was changed. ***"
echo "*** The system will now reboot. ***"
echo "***********************************"
echo
fi
echo "Unmounting file systems."
/sbin/umount -a -r
/sbin/mount -n -o remount,ro /
echo "Rebooting system."
sleep 2
reboot -f
fi
# Remount the root filesystem in read-write mode
echo "Remounting root device with read-write enabled."
/sbin/mount -w -v -n -o remount /
if [ $? -gt 0 ] ; then
echo
echo "Attempt to remount root device as read-write failed! This is going to"
echo "cause serious problems."
echo
echo "If you're using the UMSDOS filesystem, you **MUST** mount the root partition"
echo "read-write! You can make sure the root filesystem is getting mounted "
echo "read-write with the 'rw' flag to Loadlin:"
echo
echo "loadlin vmlinuz root=/dev/hda1 rw (replace /dev/hda1 with your root device)"
echo
echo "Normal bootdisks can be made to mount a system read-write with the rdev command:"
echo
echo "rdev -R /dev/fd0 0"
echo
echo "You can also get into your system by using a boot disk with a command like this"
echo "on the LILO prompt line: (change the root partition name as needed)"
echo
echo "LILO: mount root=/dev/hda1 rw"
echo
echo "Please press ENTER to continue, then reboot and use one of the above methods to"
echo -n "get into your machine and start looking for the problem. "
read junk;
fi
else
echo "Testing root filesystem status: read-write filesystem"
if cat /etc/fstab | grep ' / ' | grep umsdos 1> /dev/null 2> /dev/null ; then
ROOTTYPE="umsdos"
fi
if [ ! "$ROOTTYPE" = "umsdos" ]; then # no warn for UMSDOS
echo
echo "*** ERROR: Root partition has already been mounted read-write. Cannot check!"
echo
echo "For filesystem checking to work properly, your system must initially mount"
echo "the root partition as read only. Please modify your kernel with 'rdev' so that"
echo "it does this. If you're booting with LILO, add a line:"
echo
echo " read-only"
echo
echo "to the Linux section in your /etc/lilo.conf and type 'lilo' to reinstall it."
echo
echo "If you boot from a kernel on a floppy disk, put it in the drive and type:"
echo " rdev -R /dev/fd0 1"
echo
echo "If you boot from a bootdisk, or with Loadlin, you can add the 'ro' flag."
echo
echo "This will fix the problem *AND* eliminate this annoying message. :^)"
echo
echo -n "Press ENTER to continue. "
read junk;
fi
fi # Done checking root filesystem
if [ -x /etc/rc.d/rc.devfsd ]; then
/etc/rc.d/rc.devfsd start
fi
# Mount sysfs next, if the kernel supports it:
if [ -d /sys ]; then
if cat /proc/filesystems | grep -w sysfs 1> /dev/null 2> /dev/null ; then
if ! cat /proc/mounts | grep -w sysfs 1> /dev/null 2> /dev/null ; then
/sbin/mount -v sysfs /sys -n -t sysfs
fi
fi
fi
# Initialize udev to manage /dev entries for 2.6.x kernels:
if [ -x /etc/rc.d/rc.udev ]; then
if ! grep -w nohotplug /proc/cmdline 1> /dev/null 2> /dev/null ; then
/etc/rc.d/rc.udev
fi
fi
# Enable swapping:
/sbin/swapon -a
# Test to see if the root partition is read-only, like it ought to be.
READWRITE=no
if touch /fsrwtestfile 2>/dev/null; then
rm -f /fsrwtestfile
READWRITE=yes
else
echo "Testing root filesystem status: read-only filesystem"
fi
# See if a forced filesystem check was requested at shutdown:
if [ -r /etc/forcefsck ]; then
FORCEFSCK="-f"
fi
# Check the root filesystem:
if [ ! $READWRITE = yes ]; then
RETVAL=0
if [ ! -r /etc/fastboot ]; then
echo "Checking root filesystem:"
/sbin/fsck $FORCEFSCK -C -a /
RETVAL=$?
fi
# An error code of 2 or higher will require a reboot.
if [ $RETVAL -ge 2 ]; then
# An error code equal to or greater than 4 means that some errors
# could not be corrected. This requires manual attention, so we
# offer a chance to try to fix the problem in single-user mode:
if [ $RETVAL -ge 4 ]; then
echo
echo "*********************************************
**************"
echo "*** An error occurred during the root filesystem check. ***"
echo "*** You will now be given a chance to log into the ***"
echo "*** system in single-user mode to fix the problem. ***"
echo "*** ***"
echo "*** If you are using the ext2 filesystem, running ***"
echo "*** 'e2fsck -v -y <partition>' might help. ***"
echo "*********************************************
**************"
echo
echo "Once you exit the single-user shell, the system will reboot."
echo
PS1="(Repair filesystem) \#"; export PS1
sulogin
else # With an error code of 2 or 3, reboot the machine automatically:
echo
echo "***********************************"
echo "*** The filesystem was changed. ***"
echo "*** The system will now reboot. ***"
echo "***********************************"
echo
fi
echo "Unmounting file systems."
/sbin/umount -a -r
/sbin/mount -n -o remount,ro /
echo "Rebooting system."
sleep 2
reboot -f
fi
# Remount the root filesystem in read-write mode
echo "Remounting root device with read-write enabled."
/sbin/mount -w -v -n -o remount /
if [ $? -gt 0 ] ; then
echo
echo "Attempt to remount root device as read-write failed! This is going to"
echo "cause serious problems."
echo
echo "If you're using the UMSDOS filesystem, you **MUST** mount the root partition"
echo "read-write! You can make sure the root filesystem is getting mounted "
echo "read-write with the 'rw' flag to Loadlin:"
echo
echo "loadlin vmlinuz root=/dev/hda1 rw (replace /dev/hda1 with your root device)"
echo
echo "Normal bootdisks can be made to mount a system read-write with the rdev command:"
echo
echo "rdev -R /dev/fd0 0"
echo
echo "You can also get into your system by using a boot disk with a command like this"
echo "on the LILO prompt line: (change the root partition name as needed)"
echo
echo "LILO: mount root=/dev/hda1 rw"
echo
echo "Please press ENTER to continue, then reboot and use one of the above methods to"
echo -n "get into your machine and start looking for the problem. "
read junk;
fi
else
echo "Testing root filesystem status: read-write filesystem"
if cat /etc/fstab | grep ' / ' | grep umsdos 1> /dev/null 2> /dev/null ; then
ROOTTYPE="umsdos"
fi
if [ ! "$ROOTTYPE" = "umsdos" ]; then # no warn for UMSDOS
echo
echo "*** ERROR: Root partition has already been mounted read-write. Cannot check!"
echo
echo "For filesystem checking to work properly, your system must initially mount"
echo "the root partition as read only. Please modify your kernel with 'rdev' so that"
echo "it does this. If you're booting with LILO, add a line:"
echo
echo " read-only"
echo
echo "to the Linux section in your /etc/lilo.conf and type 'lilo' to reinstall it."
echo
echo "If you boot from a kernel on a floppy disk, put it in the drive and type:"
echo " rdev -R /dev/fd0 1"
echo
echo "If you boot from a bootdisk, or with Loadlin, you can add the 'ro' flag."
echo
echo "This will fix the problem *AND* eliminate this annoying message. :^)"
echo
echo -n "Press ENTER to continue. "
read junk;
fi
fi # Done checking root filesystem
Außerdem sagte ich nicht dem Init-Skript das exec entziehen sondern dem rc.sshd, vllt solltest du mal mit lesen anfangen, der Satz "Wenn Samba ein Teil des initd ist" zeugt wohl davon das du nicht gelesen hast (oder nicht weisst das inetd und (SysV)init ganz unterschiedliche Sachen sind).
#7
geschrieben 31. Juli 2005 - 11:34
Hmm, die verschiedenen Ansätze werde ich mal ausprobieren, obwohl ich eigentlich nicht an den Rechten von Systemscripten herumschreiben will.
Von den Unterschieden in den Runlevels zwischen Debian und Sys V hab ich keine Ahnung weiter...
Gruß,
blue32
Von den Unterschieden in den Runlevels zwischen Debian und Sys V hab ich keine Ahnung weiter...
Gruß,
blue32
These guys are the best surfers in the world.
No surfboard, no wetsuit, no worries.
Phil, speaking about dolphins
No surfboard, no wetsuit, no worries.
Phil, speaking about dolphins
#8
geschrieben 01. August 2005 - 08:42
Sonst nimm die einfachste Lösung:
apt-get install rcconf
und dann mit rcconf die Runlevels editieren
apt-get install rcconf
und dann mit rcconf die Runlevels editieren
#9
geschrieben 01. August 2005 - 08:49
@AlienSearcher
Das klingt gut, was zum editieren hab ich gesucht. Werd ich heut abend mal ausprobieren...
Vielen Dank.
Das klingt gut, was zum editieren hab ich gesucht. Werd ich heut abend mal ausprobieren...
Vielen Dank.
These guys are the best surfers in the world.
No surfboard, no wetsuit, no worries.
Phil, speaking about dolphins
No surfboard, no wetsuit, no worries.
Phil, speaking about dolphins
Thema verteilen:
Seite 1 von 1