pcscd daemon startet nicht automatisch

wupi

Vice Admiral
Registriert
Sep. 2007
Beiträge
6.994
Hallo,
ich habe hier Linux Mint am laufen das auf Ubuntu basiert.
Ich habe für die smartcard unterstützug pcsc-lite installiert aber der dienst pcscd startet nicht automatisch. Nur wenn ich sudo pcscd im terminal eingebe startet er und alles ist gut. Kann mir jemand bei dem Problem helfen ? Ich bin kein Linux Profi und habe über eine Stunde Rumprobiert und komme einfach nicht weiter.
 
Ists kein Eintrag von pcscd unter /etc/rc0-6.d zu finden?
Falls nicht zu finden, könntest vielleicht probieren mit update-rc.d hinzuzufügen und gucken was passiert.
 
Hi

Öffne mal unten links das Menü, gehe dann oben rechts auf "All applications" > "Administration" > "Services". Dort solltest du es dann auswählen können, sofern es über die Paketverwaltung installiert wurde.


mfg
aki
 
Sug82 schrieb:
Ists kein Eintrag von pcscd unter /etc/rc0-6.d zu finden?
Falls nicht zu finden, könntest vielleicht probieren mit update-rc.d hinzuzufügen und gucken was passiert.
Es steht da drinne, das hab ich auch schon rausgefunden. :(

@aki
Hab es von Hand installiert.

Hier mal der Inhalt.

Code:
#! /bin/sh
#
# /etc/init.d/pcscd
# Start/Stop/Restart PCSC Lite resource manager daemon
#
# Carlos Prados Bocos <cprados@debian.org>
# modifications by Ludovic Rousseau <rousseau@debian.org>

### BEGIN INIT INFO
# Provides: pcscd
# Required-Start: $local_fs $remote_fs $syslog
# Required-Stop: $local_fs $remote_fs $syslog
# Should-Start: udev hal
# Should-Stop: udev hal
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Daemon to access a smart card using PC/SC
# Description: The PC/SC daemon is used to dynamically allocate/deallocate
#     reader drivers at runtime and manage connections to the readers.
### END INIT INFO

PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="PCSC Lite resource manager"
NAME=pcscd
DAEMON=/usr/sbin/$NAME

PIDFILE=/var/run/pcscd/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

# Check if /var/run/pcscd exists, if not, create it.
if [ ! -d /var/run/pcscd/ ]; then
        mkdir -p -m 0755 /var/run/pcscd/
fi

# if you need to pass arguments to pcscd you should edit the file
# /etc/default/pcscd and add a line 
# DAEMON_ARGS="--your-option"

# Gracefully exit if the package has been removed (but not purged).
[ -x "$DAEMON" ] || exit 0

# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh

# Define LSB log_* functions.
. /lib/lsb/init-functions

# Include pcscd defaults if available
if [ -f /etc/default/pcscd ] ; then
    . /etc/default/pcscd
fi

# get LANG variable (code from /etc/init.d/keymap.sh)
ENV_FILE="none"
[ -r /etc/environment ] && ENV_FILE="/etc/environment"
[ -r /etc/default/locale ] && ENV_FILE="/etc/default/locale"

value=$(egrep "^[^#]*LANG=" $ENV_FILE | tail -n1 | cut -d= -f2)
eval LANG=$value

#
# Function that starts the daemon/service
#
do_start()
{
    # Return
    #   0 if daemon has been started
    #   1 if daemon was already running
    #   2 if daemon could not be started
    start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
        || return 1
    start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
        $DAEMON_ARGS \
        || return 2
    # Add code here, if necessary, that waits for the process to be ready
    # to handle requests from services started subsequently which depend
    # on this one.  As a last resort, sleep for some time.
}

#
# Function that stops the daemon/service
#
do_stop()
{
    # Return
    #   0 if daemon has been stopped
    #   1 if daemon was already stopped
    #   2 if daemon could not be stopped
    #   other if a failure occurred
    start-stop-daemon --stop --quiet --retry=3 --pidfile $PIDFILE --name $NAME
    RETVAL="$?"
    [ "$RETVAL" = 2 ] && return 2
}

#
# Function that sends a SIGHUP to the daemon/service
#
do_reload() {
    #
    # If the daemon can reload its configuration without
    # restarting (for example, when it is sent a SIGHUP),
    # then implement that here.
    #
    start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
    return 0
}

case "$1" in
  start)
    [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
    do_start
    case "$?" in
        0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
        2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
    esac
    ;;
  stop)
    [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
    do_stop
    case "$?" in
        0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
        2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
    esac
    ;;
  #reload|force-reload)
    #
    # If do_reload() is not implemented then leave this commented out
    # and leave 'force-reload' as an alias for 'restart'.
    #
    #log_daemon_msg "Reloading $DESC" "$NAME"
    #do_reload
    #log_end_msg $?
    #;;
  restart|force-reload)
    #
    # If the "reload" option is implemented then remove the
    # 'force-reload' alias
    #
    log_daemon_msg "Restarting $DESC" "$NAME"
    do_stop
    case "$?" in
      0|1)
        do_start
        case "$?" in
            0) log_end_msg 0 ;;
            1) log_end_msg 1 ;; # Old process is still running
            *) log_end_msg 1 ;; # Failed to start
        esac
        ;;
      *)
          # Failed to stop
        log_end_msg 1
        ;;
    esac
    ;;
  *)
    #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
    echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
    exit 3
    ;;
esac

:
 
Hab mal ein wenig rumgegoogelt aber mehr als "Runlevel auf 5 setzen" war nicht drin :/
 
Runlevel 5 hat es dummerweise schon und es funktioniert trotzdem nicht. :(
 
Hmm, mach mal nen backup des Scripts der wirklich unter /etc/init.d/ liegt. In der Original mach mal ganz unten ein exit 0
Was sagt das prog wenn du es über "/etc/init.d/pcscd start" startest?
 
Exit 0 bringt leider nichts.
Wenn ich /etc/init.d/pcscd start eingebe funktioniert es nicht, wenn ich sudo pcscd eingebe funktioniert es aber.
 
Hey.

wupi schrieb:
Exit 0 bringt leider nichts.
Wenn ich /etc/init.d/pcscd start eingebe funktioniert es nicht
Gibt es eine Fehlermeldung? Hast du auch
Code:
sudo /etc/init.d/pcscd start
probiert?

Edit: Dienste starten/beenden und das darauffolgende Kapitel durchlesen.
 
Zuletzt bearbeitet:
Da kommt keine Fehlermeldung, bin mir sicher das ich das mit sudo gemacht habe, werde es nachher nochmal probieren.
Den Link kenne ich schon, ich werde mal versuchen meine eigenes Script zu erstellen. :)

Code:
sudo /etc/init.d/pcscd start
Da kommt keine fehlermeldung, noch startet es.
Ich kann es nicht nachvollziehen, es funktioniert einfach nicht. :(
 
Zuletzt bearbeitet:
Ganz einfach wenn du $PATH eingibst siehste ja die Verzeichnisse die Indexiert werden. Da ist dein pcscd Deamon drinne, deshalb kannste das so auch starten.
Wenn du nun dein Gurkensystem startest werden über das inittool deine Dienste gestartet über die Scripte die in /etc/init.d liegen diese sind in die rc1-6.d verzeichnisse verlinkt (Runlevel in denen die dann laufen).
Das heißt dein Sys startet und fährt die Verknüpfungen in rc1.d bis rc6.d ab.
Es wird ja nicht nur der Dienst gestartet sondern beispielsweise bei Samba das Loggen des Dienstkrams gemacht.

Gucke mal ob du Logfiles von dem Prozess bekommst.
Was sagen die dmesg, wenn du in /etc/init.d "sudo sh pcdcd start" eingibst
 
Zuletzt bearbeitet:
Zurück
Oben