Codice: Seleziona tutto
ps aux | grep metern.php
Se attivo ti risponde con due righe, se non attivo solo con una (il comando grep che stai eseguendo)
Codice: Seleziona tutto
ps aux | grep metern.php
Codice: Seleziona tutto
pi@raspberrypi:~ $ ps aux | grep metern.php
pi 3899 0.0 0.4 4528 2008 pts/1 S+ 18:27 0:00 grep --color=auto metern.php
Codice: Seleziona tutto
[Unit]
Description=bmp085
[Service]
Type=oneshot
ExecStart=/var/www/MyScripts/pa.py > /run/shm/metern7.txt
[Install]
WantedBy=multi-user.targe
Codice: Seleziona tutto
root@raspberrypi:/home/pi# insserv
le bmp085.serviceroot@raspberrypi:/home/pi# systemctl enable bmp085.service
Failed to execute operation: Invalid argument
Codice: Seleziona tutto
ExecStart=/usr/bin/python /var/www/MyScripts/pa.py > /run/shm/metern7.txt
Codice: Seleziona tutto
29/05/2016 20:45:21 Starting meterN (8671)
Abording. Can't open config_met3.php.
29/05/2016 21:39:49 Starting meterN (23642)
Abording. Can't open config_met3.php.
Codice: Seleziona tutto
pi@raspberrypi:~ $ ls -l /var/www/
totale 28
drwxr-xr-x 11 www-data www-data 4096 apr 25 21:06 123solar
drwxr-xr-x 2 pi pi 4096 apr 13 21:45 comapps
drwxr-xr-x 2 root root 4096 gen 31 21:36 html
drwxr-xr-x 11 www-data www-data 4096 mag 29 19:58 metern
drwxrwxrwx 2 pi pi 4096 mag 26 00:06 MyScripts
drwxrwxrwx 3 www-data www-data 4096 mag 29 19:01 _NEW
-rw-r--r-- 1 root root 19 gen 28 21:19 test.php
Codice: Seleziona tutto
~ $ ls -l /var/www/MyScripts/pa.py
-rwxr-xr-x 1 pi pi 643 mag 26 00:20 /var/www/MyScripts/pa.py
Codice: Seleziona tutto
sudo nano /etc/systemd/system/bmp085.service
[Unit]
Description=bmp085
[Service]
Type=oneshot
ExecStart=/usr/bin/python /var/www/MyScripts/pa.py > /run/shm/metern7.txt
[Install]
WantedBy=multi-user.targe
root@raspberrypi:/home/pi# ls -l /etc/systemd/system/bmp085.service
-rw-r--r-- 1 root root 161 mag 29 20:04 /etc/systemd/system/bmp085.service
Codice: Seleziona tutto
ceroot@raspberrypi:/home/pi# insserv
root@raspberrypi:/home/pi# systemctl enable bmp085.service
Failed to execute operation: Invalid argument
Codice: Seleziona tutto
root@raspberrypi:/home/pi# systemctl status bmp085.service
● bmp085.service - bmp085
Loaded: loaded (/etc/systemd/system/bmp085.service; enabled)
Active: inactive (dead) since dom 2016-05-29 20:06:02 CEST; 1h 23min ago
Process: 296 ExecStart=/usr/bin/python /var/www/MyScripts/pa.py > /run/shm/metern7.txt (code=exited, status=0/SUCCESS)
Main PID: 296 (code=exited, status=0/SUCCESS)
mag 29 20:05:57 raspberrypi systemd[1]: Starting bmp085...
mag 29 20:06:02 raspberrypi python[296]: 7_1(25.50*C)
mag 29 20:06:02 raspberrypi python[296]: 7_2(985.72*Pa)
mag 29 20:06:02 raspberrypi python[296]: 7_3(231.17*m)
mag 29 20:06:02 raspberrypi python[296]: 7_4(985.76*Pm)
mag 29 20:06:02 raspberrypi systemd[1]: Started bmp085.
Codice: Seleziona tutto
pi@raspberrypi:~ $ systemctl status bmp085.service
● bmp085.service - bmp085
Loaded: loaded (/etc/systemd/system/bmp085.service; enabled)
Active: inactive (dead) since dom 2016-05-29 20:06:02 CEST; 1h 36min ago
Process: 296 ExecStart=/usr/bin/python /var/www/MyScripts/pa.py > /run/shm/metern7.txt (code=exited, status=0/SUCCESS)
Main PID: 296 (code=exited, status=0/SUCCESS)
Codice: Seleziona tutto
root@raspberrypi:~# sudo ADHT_metern.py 22 4 6
6_1(19.1*C)
6_2(43.6*%)
root@raspberrypi:~# insserv
root@raspberrypi:~# systemctl enable dht22.service
root@raspberrypi:~# systemctl start dht22.service
Job for dht22.service failed. See 'systemctl status dht22.service' and 'journalctl -xn' for details.
root@raspberrypi:~# sudo systemctl status dht22.service
● dht22.service - dht22
Loaded: loaded (/etc/systemd/system/dht22.service; enabled)
Active: failed (Result: exit-code) since mer 2016-11-16 08:55:20 CET; 24s ago
Process: 20706 ExecStart=/usr/local/bin/dht22.sh 22 4 6 (code=exited, status=1/FAILURE)
Main PID: 20706 (code=exited, status=1/FAILURE)
nov 16 08:55:20 raspberrypi dht22.sh[20706]: [40B blob data]
nov 16 08:55:20 raspberrypi dht22.sh[20706]: [40B blob data]
nov 16 08:55:20 raspberrypi systemd[1]: dht22.service: main process exited, ...E
nov 16 08:55:20 raspberrypi systemd[1]: Failed to start dht22.
nov 16 08:55:20 raspberrypi systemd[1]: Unit dht22.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.
root@raspberrypi:~# sudo journalctl -xn
-- Logs begin at mer 2016-11-16 08:45:13 CET, end at mer 2016-11-16 08:56:14 CET
nov 16 08:55:20 raspberrypi dht22.sh[20706]: [40B blob data]
nov 16 08:55:20 raspberrypi systemd[1]: dht22.service: main process exited, code
nov 16 08:55:20 raspberrypi systemd[1]: Failed to start dht22.
-- Subject: L'unità dht22.service è fallita
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- L'unità dht22.service è fallita.
--
-- Il risultato è failed.
nov 16 08:55:20 raspberrypi systemd[1]: Unit dht22.service entered failed state.
nov 16 08:55:44 raspberrypi sudo[21811]: root : TTY=pts/0 ; PWD=/root ; USER=roo
nov 16 08:55:44 raspberrypi sudo[21811]: pam_unix(sudo:session): session opened
nov 16 08:55:44 raspberrypi sudo[21811]: pam_unix(sudo:session): session closed
nov 16 08:55:46 raspberrypi sshd[20773]: Did not receive identification string f
nov 16 08:56:14 raspberrypi sudo[22869]: root : TTY=pts/0 ; PWD=/root ; USER=roo
nov 16 08:56:14 raspberrypi sudo[22869]: pam_unix(sudo:session): session opened
root@raspberrypi:~#
Visitano il forum: Nessuno e 0 ospiti