automatischer Neustart

lawanscha

lawanscha

dada
Hi Leute,

ich habe ein kleines App was ich per Skript starte unter Ubuntu in der /etc/rc2.d
Leider kann es sein (weiss noch nicht warum) dass es sich beendet. Dann soll es sich aber von allein wieder starten! Was für Möglichkeiten habe ich um soetwas zu realisieren?? Danke für Eure Vorschläge im voraus!!

DAV
 
Cron würde gehen. Oder ein zweites Skript das in einer Schleife läuft und das erste überprüft.
 
was muss man den bei Cron einstellen damit das Apps imma läuft oder sicht neu startet??
 
gibts dafür nicht die einträge in rc.conf?

:respawn: oder so?

EDIT:

ok, alles müll. es war die inittab

Code:
# Example lines for starting a login manager
#x:5:respawn:/usr/bin/xdm -nodaemon
#x:5:respawn:/usr/sbin/gdm -nodaemon
#x:5:respawn:/usr/bin/kdm -nodaemon
x:5:respawn:/usr/bin/slim >& /dev/null

sieht doch vielversprechend aus?

EDIT 2:

Code:
       The inittab file describes which processes are started  at  bootup  and
       during  normal  operation  (e.g. /etc/init.d/boot, /etc/init.d/rc, get‐
       tys...).  Init(8) distinguishes multiple runlevels, each of  which  can
       have  its  own  set of processes that are started.  Valid runlevels are
       0-6 plus A, B, and C for ondemand entries.  An  entry  in  the  inittab
       file has the following format:

              id:runlevels:action:process

       Lines beginning with `#' are ignored.

       id     is a unique sequence of 1-4 characters which identifies an entry
              in inittab (for versions of sysvinit compiled with the old libc5
              (< 5.2.18) or a.out libraries the limit is 2 characters).

              Note:  traditionally,  for  getty and other login processes, the
              value of the id field is kept the same as the suffix of the cor‐
              responding  tty,  e.g. 1 for tty1. Some ancient login accounting
              programs might expect this, though I can't think of any.

       runlevels
              lists the runlevels for which the  specified  action  should  be
              taken.

       action describes which action should be taken.

       process
              specifies  the  process  to  be  executed.  If the process field
              starts with a `+' character, init will  not  do  utmp  and  wtmp
              accounting  for  that  process.   This is needed for gettys that
              insist on doing their own utmp/wtmp housekeeping.  This is  also
              a historic bug.

       The  runlevels field may contain multiple characters for different run‐
       levels.  For example, 123 specifies that the process should be  started
       in  runlevels 1, 2, and 3.  The runlevels for ondemand entries may con‐
       tain an A, B, or C.  The runlevels field of sysinit, boot, and bootwait
       entries are ignored.

       When the system runlevel is changed, any running processes that are not
       specified for the new runlevel are killed,  first  with  SIGTERM,  then
       with SIGKILL.

       Valid actions for the action field are:

       respawn
              The  process  will  be  restarted  whenever  it terminates (e.g.
              getty).

bei dir müsste das dann wohl so aussehen:

Code:
foo:2:respawn:su -u deinusername -c dein-script
 
Zuletzt bearbeitet:
Stimmt, da war was :) Mein Fehler, Sorry. Ist natürlich viel eleganter.
 
Alternativ kann man Tools wie z.B. monit einsetzen, dann kann man sich auch gleich beim Ausfall eine Mail schicken. Oder z.B. pswatcher
 

Ähnliche Themen

Keine grafische Oberfläche (Debian Installation)

Service oder Screen überwachen und ggf. Neustarten?!

Lokale GUI-Programme mit php-cgi starten

Bootloader nach update weg

Creative Soundblaster läuft nicht!

Zurück
Oben