Nowe posty

Autor Wątek: whatpulse  (Przeczytany 3993 razy)

El Nino

  • Gość
whatpulse
« dnia: 2010-06-20, 23:42:57 »
witam, jestem nowym uzytkownikiem forum, jak i systemu linux, :)

mam takowy problem, gdy chce zainstalowac whatpulse (program liczy stukniecia w klawiature klikniecia mysza, przejechany dystans, fajna sprawa, uzywam na widnowsie), w kazdym razie wyskakuje komunikat:

''Failed to open device /dev/input/event0! Make sure you have set up appropriate read permissions.''

o co tu chodzi? tlumaczylem na polski, ale nadal nie bardzo wiem :)
pozdrawiam

ra-v

  • Gość
whatpulse
« Odpowiedź #1 dnia: 2010-06-21, 21:19:41 »
Google Translate  mówi
Cytuj
Nie udało się otworzyć urządzenia / dev/input/event0! Upewnij się, że tworzy odpowiednie uprawnienia do odczytu
Czyli też z połowę zrozumiałem:)

A serio jako root wpisz
chmod o+r /dev/input/event0
lub jeśli nadal nie zadziała
chmod o+rw /dev/input/event0
To powinno nadać prawa do odczytu (lub odczytu i  zapisu) dla tego urządzenia.

Kiedyś korzystałem z jakiegoś programu dla Linuxa, który robił coś podobnego, ale za Chiny nie pamiętam co to było (czasy Fedora Core 1)

El Nino

  • Gość
whatpulse
« Odpowiedź #2 dnia: 2010-06-23, 23:01:36 »
Dobrze że chociaż na tym forum znalazł się ktoś życzliwy i chętny do pomocy :)
linuxa używam od kilku dni, więc nie wiem czy dobrze zrozumiałem, ale jako root wpisz, czyli mam wpisać do terminalu dane komendy. Wpisałem, wyskakuje:
Operation not permitted, czyli operacja nie powiodła się. Zarówno po wpisaniu pierwszej, jak i drugiej komendy.
A może coś źle robię? Prosze o wyrozumiałość, jestem nowym użytkownikiem linuxa i za wiele jeszcze nie wiem :)

a, dodam jeszcze, może warto, że do ściągnięcia jest także skrypt, to jego treść:

echo "This script sets up read permissions for the kernel's event devices 
in order for your user to be able to run WhatPulse. It will create a new
group called 'input', add your username to that group, and make the event
devices readable for the group. Press Ctrl+C now if you don't want this,
or press Return to continue."

read temp

if [ "`whoami`" != "root" ] ; then
    echo "This script must be run as root (e.g. using sudo). Will now exit."
    exit
fi

# set up persistent settings

if [ -r /etc/udev/rules.d/99-whatpulse-input.rules ] ; then
    echo "/etc/udev/rules.d/99-whatpulse-input.rules already exists. Will not change it."
else
    echo "KERNEL==\\"event*\\",       NAME=\\"input/%k\\", MODE=\\"640\\", GROUP=\\"input\\"" >> /etc/udev/rules.d/99-whatpulse-input.rules
    if [ $? != 0 ] ; then
        echo "There was some error creating the udev rule file. Sorry. Quitting."
        exit
    fi
    echo "UDEV rules file has been set up."
fi

if [ -n "`cat /etc/group | grep -e ^input:`" ] ; then
    echo "Group 'input' already exists!"
else
    groupadd input
    echo "Created group 'input'."
fi

echo "Please enter the username that should get added to the group:"
read username

if [ -z "$username" ] ; then
    echo "What do you mean by an empty username? Quitting."
    exit
fi

if [ -z "`cat /etc/passwd | grep -e ^$username:`" ] ; then
    echo "This username doesn't exist. Quitting."
    exit
fi

gpasswd -a $username input &> /dev/null
if [ $? != 0 ] ; then
    # maybe this is openSUSE (or a similar system)
    usermod -A input $username &> /dev/null
    if [ $? != 0 ] ; then
        echo "There was a problem adding your username to the group 'input'.
Please add your user to the 'input' group yourself."
    else
        echo "Added user '$username' to group 'input', using the special openSUSE method."
    fi
else
    echo "Added user '$username' to group 'input'."
fi
echo " "
echo "Setup of persistent permission settings complete."

# apply non-persistent settings so that no reboot is necessary :-)

echo " "
echo "Since the UDEV rules will only be applied when you restart your
computer, this script will now apply temporary read permissions for all
users to the device files to let you use WhatPulse immediately. You have
the chance to cancel this by pressing Ctrl+C now (which you should do if
you fear that other users on your computer might log your keyboard
events!). Otherwise press Return to continue."

read temp

find /dev/input/ -iname 'event*' -exec chmod 644 {} \\;

echo "All done, have fun using WhatPulse!"
całość do ściągnięcia na http://whatpulse.org/downloads/

gdzieś przeczytałem, że takie skypty można uruchamiać również jako root, próbowałem wpisać do terminalu sh nazwaskryptu.sh, ale wyświetliło mi, że nie można go otworzyć.
Myślę że w miarę jasno przedstawiłem swój problem, jeśli nie to jeszcze raz proszę o wyrozumiałość i rozwiązanie mojego problemu :)
z góry dzięki,
pozdrawiam

Offline Lord Darius

  • Guru
  • *****
  • Wiadomości: 1162
    • Zobacz profil
whatpulse
« Odpowiedź #3 dnia: 2010-06-24, 10:17:24 »
Cytat: El Nino
... więc nie wiem czy dobrze zrozumiałem, ale jako root wpisz, czyli mam wpisać do terminalu dane komendy. Wpisałem, wyskakuje:
Operation not permitted.
Tak w ogóle to logujesz się przed całą operacją jako root?
Spójrz bez strachu na rzecz budzącą strach, a straszność sama zniknie.
cat /etc/debian_version

El Nino

  • Gość
whatpulse
« Odpowiedź #4 dnia: 2010-06-24, 14:55:37 »
Tak, loguję sie. Wpisuje do konsoli sudo su, po czym wpisuje podane przez ra-v komendy. Nic się nie dzieje. Programu nadal zainstalowac sie nie da, bo wyskakuje

'Failed to open device /dev/input/event1! Make sure you have set up appropriate read permissions.'

Nie wiem co robić :(

ra-v

  • Gość
whatpulse
« Odpowiedź #5 dnia: 2010-06-26, 21:30:14 »
Cytuj
/dev/input/event1
Zwracaj uwagę na szczegóły:) Teraz jest event1 przedtem event0, czyli to samo zrób dla event1. A jak wyświetli event2 to zrób tak samo dla wszystkich event-ów.

El Nino

  • Gość
whatpulse
« Odpowiedź #6 dnia: 2010-06-27, 19:02:25 »
ra-v, pomogło, wielkie dzięki! Temat do zamknięcia, a Tobie nalezy się duze piwo :)