Automount vyměnitelných médií

Založil Namoot, 25. 02. 2012, 16:40:48

Předchozí téma - Další téma

Namoot

Ahoj,

Jelikož jsem potřeboval novější software (jádro), musel jsem přejít na Wheezyho. Ale nechtěl jsem mít Gnome 3, dal jsem si tam XFCE.

Řeším problém: nepřipojí se mi automaticky po vložení flashka, externí disk ani CD/DVD. Dokázal bych je připojit ručně, ale ten počítač používá víc lidí, kteří to nedokáží...
Na internetu jsem našel spoustu návodů, ale většina byla buďto klikacích, (Menu→Nastavení→vymněnitelná média→připojovat po vložení), které nastavovaly věci, které jsem měl nastavené hned po instalaci nebo doporučovaly instalaci thunar-volman (bylo nainstalováno), na wiki autofs a udev (nainstalováno, ale opravdu nejsem dobrý angličtinář, nerozumím tomu), všechny
návody měly stejný výsledek-Po kliknutí na ikonu na ploše chybu "Připojení XXXXX se nezdařilo, not authorized". To jako, že nemám práva?

Fakt už nevím, proto bych prosil, jestli by mi někdo poradil, pokud měl stejný nebo podobný problém. Díky moc, lidi.
HP Probook 4530, Intel Core i3b(2.2 GHz), 4 GB RAM, Debian Squeeze (stable), Gnome 2.30.2
Debian především, už za tu krátkou dobu mi přirostl k srdci. Aby ne po těch pěti reinstalech. :D

Roman Horník

Debian Sid/Experimental 64bit + Mate Desktop Environment
* CPU: Intel i5 3570
* GPU: NVIDIA GTX650 1GD5
* MB: Lenovo IH61M
* RAM: 16GiB Deutsche Demokratische Republik 3 @ 1600MHz

Namoot

#2
Citace od: Roman Horník kdy 25. 02. 2012, 16:48:00
Jseš v /etc/sudoers?

#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root ALL=(ALL:ALL) ALL

# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d


To je můj /etc/sudoers. Zdá se mi, že ne, ale nevím.
HP Probook 4530, Intel Core i3b(2.2 GHz), 4 GB RAM, Debian Squeeze (stable), Gnome 2.30.2
Debian především, už za tu krátkou dobu mi přirostl k srdci. Aby ne po těch pěti reinstalech. :D

Roman Horník

Nejseš, spusť gksu gedit /etc/sudoers a přidej si do toho souboru něco jako namoot ALL=(ALL) ALL
Debian Sid/Experimental 64bit + Mate Desktop Environment
* CPU: Intel i5 3570
* GPU: NVIDIA GTX650 1GD5
* MB: Lenovo IH61M
* RAM: 16GiB Deutsche Demokratische Republik 3 @ 1600MHz

Namoot

Uděláno. Nepomohlo. (neboj, změnil jsem jméno uživatele.. :D)
HP Probook 4530, Intel Core i3b(2.2 GHz), 4 GB RAM, Debian Squeeze (stable), Gnome 2.30.2
Debian především, už za tu krátkou dobu mi přirostl k srdci. Aby ne po těch pěti reinstalech. :D

Roman Horník

A uložils to? :D

Jinak tady jsem našel řešení.
Citace od: anglickyThis is the problem. dbus-launch needs to be run AFTER ck-launch-session, which does not happen in this case. The if-for loop before the line with "exec..." runs a script in /etc/X11/xinit/xinitrc.d/ that runs dbus-launch, and so startxfce4 does not. Just comment out the whole if-fi thing and you are good to go smile.

Citace od: strojově přeloženoTo je problém. dbus-start je třeba spustit PO ck-launch-session, což se neděje v tomto případě.if-for smyčka před řádek s "exec ..." spustí skript v / etc/X11/xinit/xinitrc.d /, která se spouští dbus-launch, a tak startxfce4 ne. Jen komentář mimo celek, if-fi věc a jste dobří jít úsměv.

Takže protože tohle je pro Arche, nejspíš onen skript najdeš v /etc/X11/Xsession

Pro jistotu sem dej obsah /etc/X11/Xsession
Debian Sid/Experimental 64bit + Mate Desktop Environment
* CPU: Intel i5 3570
* GPU: NVIDIA GTX650 1GD5
* MB: Lenovo IH61M
* RAM: 16GiB Deutsche Demokratische Republik 3 @ 1600MHz

Namoot

#6
#!/bin/sh
#
# /etc/X11/Xsession
#
# global Xsession file -- used by display managers and xinit (startx)

# $Id: Xsession 967 2005-12-27 07:20:55Z dnusinow $

set -e

PROGNAME=Xsession

message () {
  # pretty-print messages of arbitrary length; use xmessage if it
  # is available and $DISPLAY is set
  MESSAGE="$PROGNAME: $*"
  echo "$MESSAGE" | fold -s -w ${COLUMNS:-80} >&2
  if [ -n "$DISPLAY" ] && which xmessage > /dev/null 2>&1; then
    echo "$MESSAGE" | fold -s -w ${COLUMNS:-80} | xmessage -center -file -
  fi
}

message_nonl () {
  # pretty-print messages of arbitrary length (no trailing newline); use
  # xmessage if it is available and $DISPLAY is set
  MESSAGE="$PROGNAME: $*"
  echo -n "$MESSAGE" | fold -s -w ${COLUMNS:-80} >&2;
  if [ -n "$DISPLAY" ] && which xmessage > /dev/null 2>&1; then
    echo -n "$MESSAGE" | fold -s -w ${COLUMNS:-80} | xmessage -center -file -
  fi
}

errormsg () {
  # exit script with error
  message "$*"
  exit 1
}

internal_errormsg () {
  # exit script with error; essentially a "THIS SHOULD NEVER HAPPEN" message
  # One big call to message() for the sake of xmessage; if we had two then
  # the user would have dismissed the error we want reported before seeing the
  # request to report it.
  errormsg "$*" \
           "Please report the installed version of the \"x11-common\"" \
           "package and the complete text of this error message to" \
           "<debian-x@lists.debian.org>."
}

# initialize variables for use by all session scripts

OPTIONFILE=/etc/X11/Xsession.options

SYSRESOURCES=/etc/X11/Xresources
USRRESOURCES=$HOME/.Xresources

SYSSESSIONDIR=/etc/X11/Xsession.d
USERXSESSION=$HOME/.xsession
USERXSESSIONRC=$HOME/.xsessionrc
ALTUSERXSESSION=$HOME/.Xsession
ERRFILE=$HOME/.xsession-errors

# attempt to create an error file; abort if we cannot
if (umask 077 && touch "$ERRFILE") 2> /dev/null && [ -w "$ERRFILE" ] &&
  [ ! -L "$ERRFILE" ]; then
  chmod 600 "$ERRFILE"
elif ERRFILE=$(tempfile 2> /dev/null); then
  if ! ln -sf "$ERRFILE" "${TMPDIR:=/tmp}/xsession-$USER"; then
    message "warning: unable to symlink \"$TMPDIR/xsession-$USER\" to" \
             "\"$ERRFILE\"; look for session log/errors in" \
             "\"$TMPDIR/xsession-$USER\"."
  fi
else
  errormsg "unable to create X session log/error file; aborting."
fi

exec >>"$ERRFILE" 2>&1

echo "$PROGNAME: X session started for $LOGNAME at $(date)"

# sanity check; is our session script directory present?
if [ ! -d "$SYSSESSIONDIR" ]; then
  errormsg "no \"$SYSSESSIONDIR\" directory found; aborting."
fi

# Attempt to create a file of non-zero length in /tmp; a full filesystem can
# cause mysterious X session failures.  We do not use touch, :, or test -w
# because they won't actually create a file with contents.  We also let standard
# error from tempfile and echo go to the error file to aid the user in
# determining what went wrong.
WRITE_TEST=$(tempfile)
if ! echo "*" >>"$WRITE_TEST"; then
  message "warning: unable to write to ${WRITE_TEST%/*}; X session may exit" \
          "with an error"
fi
rm -f "$WRITE_TEST"

# use run-parts to source every file in the session directory; we source
# instead of executing so that the variables and functions defined above
# are available to the scripts, and so that they can pass variables to each
# other
SESSIONFILES=$(run-parts --list $SYSSESSIONDIR)
if [ -n "$SESSIONFILES" ]; then
  set +e
  for SESSIONFILE in $SESSIONFILES; do
    . $SESSIONFILE
  done
  set -e
fi

exit 0

# vim:set ai et sts=2 sw=2 tw=80:



:D S tím uložením si mě fakt hodně pobavil! :D (a ještě jsem si to radši zkontroloval. :D)
HP Probook 4530, Intel Core i3b(2.2 GHz), 4 GB RAM, Debian Squeeze (stable), Gnome 2.30.2
Debian především, už za tu krátkou dobu mi přirostl k srdci. Aby ne po těch pěti reinstalech. :D

Roman Horník

#7
Tak vedle, to nebude ten soubor. Ale možná by stačilo tohle:

mv ~/.xinitrc ~/.xinitrc.záloha
echo -e "exec ck-launch-session startxfce4\nthunar --daemon &\nEOF\nchown \$var_username:users /home/\$var_username/.xinitrc" > ~/.xinitrc


Pak to po odhlášení a následnýmu přihlášení zkus.

P. S.: Prosím, dávej pro příště výpisy mezi značky [code] a [/code]
Debian Sid/Experimental 64bit + Mate Desktop Environment
* CPU: Intel i5 3570
* GPU: NVIDIA GTX650 1GD5
* MB: Lenovo IH61M
* RAM: 16GiB Deutsche Demokratische Republik 3 @ 1600MHz

Namoot

kuba@kuba-notas:~$ mv ~/.xinitrc ~/.xinitrc.záloha
mv: nelze získat informace o ,,/home/kuba/.xinitrc": Adresář nebo soubor neexistuje


Blbé...
Za to code se omlouvám, nevěděl jsem, co je to za tlačítko..
HP Probook 4530, Intel Core i3b(2.2 GHz), 4 GB RAM, Debian Squeeze (stable), Gnome 2.30.2
Debian především, už za tu krátkou dobu mi přirostl k srdci. Aby ne po těch pěti reinstalech. :D

Roman Horník

Nevadí, použij tenhle příkaz:
echo -e "exec ck-launch-session startxfce4\nthunar --daemon &\nEOF\nchown \$var_username:users /home/\$var_username/.xinitrc" > ~/.xinitrc
Debian Sid/Experimental 64bit + Mate Desktop Environment
* CPU: Intel i5 3570
* GPU: NVIDIA GTX650 1GD5
* MB: Lenovo IH61M
* RAM: 16GiB Deutsche Demokratische Republik 3 @ 1600MHz

Namoot

Bohužel, příkaz jsem spustil, odhlásil a zase jsem se přihlásil ale beze změny..
HP Probook 4530, Intel Core i3b(2.2 GHz), 4 GB RAM, Debian Squeeze (stable), Gnome 2.30.2
Debian především, už za tu krátkou dobu mi přirostl k srdci. Aby ne po těch pěti reinstalech. :D

martlin

Základem mountování je /etc/fstab. Mám po nainstalování defaultně na konci tyto řádky

/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/sdb1       /media/usb0     auto    rw,user,noauto  0       0

a funguje to v pohodě. Tyto řádky by měly zajistit automount jak cd tak (jednoho) usb.

Namoot

HP Probook 4530, Intel Core i3b(2.2 GHz), 4 GB RAM, Debian Squeeze (stable), Gnome 2.30.2
Debian především, už za tu krátkou dobu mi přirostl k srdci. Aby ne po těch pěti reinstalech. :D

Roman Horník

Přes co se do Xfce přihlašuješ? Protože u některých se nespouští DBus, musíš pozměnit startovací skript.
Debian Sid/Experimental 64bit + Mate Desktop Environment
* CPU: Intel i5 3570
* GPU: NVIDIA GTX650 1GD5
* MB: Lenovo IH61M
* RAM: 16GiB Deutsche Demokratische Republik 3 @ 1600MHz

Namoot

Slim, šel jsem přesně podle instalace na foru..
HP Probook 4530, Intel Core i3b(2.2 GHz), 4 GB RAM, Debian Squeeze (stable), Gnome 2.30.2
Debian především, už za tu krátkou dobu mi přirostl k srdci. Aby ne po těch pěti reinstalech. :D