質問編集履歴

3

追加確認事項

2017/09/17 23:32

投稿

nagog
nagog

スコア16

test CHANGED
File without changes
test CHANGED
@@ -66,133 +66,7 @@
66
66
 
67
67
  ```
68
68
 
69
- UNIT FILE STATE
69
+ UNIT FILE STATE
70
-
71
- alsa-restore.service static
72
-
73
- alsa-state.service static
74
-
75
- alsa-store.service static
76
-
77
- alsa-utils.service masked
78
-
79
- autologin@.service enabled
80
-
81
- autovt@.service disabled
82
-
83
- avahi-daemon.service enabled
84
-
85
- bluetooth.service enabled
86
-
87
- bootlogd.service masked
88
-
89
- bootlogs.service masked
90
-
91
- bootmisc.service masked
92
-
93
- checkfs.service masked
94
-
95
- checkroot-bootclean.service masked
96
-
97
- checkroot.service masked
98
-
99
- console-getty.service disabled
100
-
101
- console-shell.service disabled
102
-
103
- container-getty@.service static
104
-
105
- cron.service enabled
106
-
107
- cryptdisks-early.service masked
108
-
109
- cryptdisks.service masked
110
-
111
- dbus-org.bluez.service enabled
112
-
113
- dbus-org.freedesktop.Avahi.service enabled
114
-
115
- dbus-org.freedesktop.hostname1.service static
116
-
117
- dbus-org.freedesktop.locale1.service static
118
-
119
- dbus-org.freedesktop.login1.service static
120
-
121
- dbus-org.freedesktop.machine1.service static
122
-
123
- dbus-org.freedesktop.timedate1.service static
124
-
125
- dbus.service static
126
-
127
- debian-fixup.service static
128
-
129
- debug-shell.service disabled
130
-
131
- dhcpcd.service enabled
132
-
133
- display-manager.service enabled
134
-
135
- emergency.service static
136
-
137
- fake-hwclock.service enabled
138
-
139
- fuse.service masked
140
-
141
- getty-static.service static
142
-
143
- getty@.service disabled
144
-
145
- halt-local.service static
146
-
147
- halt.service masked
148
-
149
- hciuart.service enabled
150
-
151
- hostname.service masked
152
-
153
- hwclock-save.service enabled
154
-
155
- hwclock.service masked
156
-
157
- hwclockfirst.service masked
158
-
159
- ifup@.service static
160
-
161
- initrd-cleanup.service static
162
-
163
- initrd-parse-etc.service static
164
-
165
- initrd-switch-root.service static
166
-
167
- initrd-udevadm-cleanup-db.service static
168
-
169
- killprocs.service masked
170
-
171
- kmod-static-nodes.service static
172
-
173
- kmod.service static
174
-
175
- lightdm.service enabled
176
-
177
- module-init-tools.service static
178
-
179
- motd.service masked
180
-
181
- mountall-bootclean.service masked
182
-
183
- mountall.service masked
184
-
185
- mountdevsubfs.service masked
186
-
187
- mountkernfs.service masked
188
-
189
- mountnfs-bootclean.service masked
190
-
191
- mountnfs.service masked
192
-
193
- nodered.service disabled
194
-
195
- packagekit-offline-update.service static
196
70
 
197
71
  packagekit.service static
198
72
 
@@ -232,37 +106,7 @@
232
106
 
233
107
  reboot.service masked
234
108
 
235
- rescue.service static
109
+ rescue.service static
236
-
237
- rmnologin.service masked
238
-
239
- rpi-display-backlight.service enabled
240
-
241
- rsync.service disabled
242
-
243
- rsyslog.service enabled
244
-
245
- rtkit-daemon.service disabled
246
-
247
- samba.service masked
248
-
249
- sendsigs.service masked
250
-
251
- serial-getty@.service disabled
252
-
253
- single.service masked
254
-
255
- ssh.service enabled
256
-
257
- ssh@.service static
258
-
259
- sshswitch.service enabled
260
-
261
- stop-bootlogd-single.service masked
262
-
263
- stop-bootlogd.service masked
264
-
265
- sudo.service disabled
266
110
 
267
111
  syslog.service enabled
268
112
 
@@ -370,28 +214,6 @@
370
214
 
371
215
  udev.service static
372
216
 
373
- udisks2.service static
374
-
375
- umountfs.service masked
376
-
377
- umountnfs.service masked
378
-
379
- umountroot.service masked
380
-
381
- urandom.service static
382
-
383
- usb_modeswitch@.service static
384
-
385
- user@.service static
386
-
387
- vncserver-virtuald.service disabled
388
-
389
- vncserver-x11-serviced.service enabled
390
-
391
- wpa_supplicant.service disabled
392
-
393
- x11-common.service masked
394
-
395
217
  ```
396
218
 
397
219
  最初は動いていたのですが、stop,disnableや killall pythonを繰り返していたら
@@ -433,3 +255,79 @@
433
255
  exit 0
434
256
 
435
257
  ```
258
+
259
+
260
+
261
+ ###追加
262
+
263
+ 追加確認事項です。
264
+
265
+ 起動時に失敗しているようです。
266
+
267
+ 理由がよくわかりません。
268
+
269
+
270
+
271
+ ```
272
+
273
+ pi@raspberrypi:~ $ sudo systemctl status test.service
274
+
275
+ ● test.service - Test
276
+
277
+ Loaded: loaded (/etc/systemd/system/test.service; enabled)
278
+
279
+ Active: failed (Result: start-limit) since 月 2017-09-18 08:19:26 JST; 39s ago
280
+
281
+ Process: 718 ExecStart=/usr/bin/python /home/pi/nas_all/test013.py (code=exited, status=1/FAILURE)
282
+
283
+ Main PID: 718 (code=exited, status=1/FAILURE)
284
+
285
+
286
+
287
+ 9月 18 08:19:25 raspberrypi systemd[1]: test.service: main process exited,...E
288
+
289
+ 9月 18 08:19:25 raspberrypi systemd[1]: Unit test.service entered failed s....
290
+
291
+ 9月 18 08:19:26 raspberrypi systemd[1]: test.service holdoff time over, sc....
292
+
293
+ 9月 18 08:19:26 raspberrypi systemd[1]: Stopping Test...
294
+
295
+ 9月 18 08:19:26 raspberrypi systemd[1]: Starting Test...
296
+
297
+ 9月 18 08:19:26 raspberrypi systemd[1]: test.service start request repeate....
298
+
299
+ 9月 18 08:19:26 raspberrypi systemd[1]: Failed to start Test.
300
+
301
+ 9月 18 08:19:26 raspberrypi systemd[1]: Unit test.service entered failed s....
302
+
303
+ Hint: Some lines were ellipsized, use -l to show in full.
304
+
305
+ ```
306
+
307
+ また、プロセスには表示されていませんでした。(文字数の関係で一部略)
308
+
309
+ ```
310
+
311
+ USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
312
+
313
+ pi 1226 0.0 0.1 2344 1444 ? S 08:19 0:00 gnome-pty-helpe
314
+
315
+ pi 1227 0.1 0.4 5960 4384 pts/0 Ss 08:19 0:00 /bin/bash
316
+
317
+ pi 1292 0.0 0.2 4220 2184 pts/0 R+ 08:22 0:00 ps aux
318
+
319
+ ```
320
+
321
+ 手動でスタートさせると確認できました。
322
+
323
+ ```
324
+
325
+ pi@raspberrypi:~ $ sudo systemctl start test.service
326
+
327
+ pi@raspberrypi:~ $ ps aux
328
+
329
+ USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
330
+
331
+ root 1384 12.4 0.9 21288 8916 ? Ssl 08:24 0:00 /usr/bin/python
332
+
333
+ ```

2

rc\.local追加

2017/09/17 23:32

投稿

nagog
nagog

スコア16

test CHANGED
File without changes
test CHANGED
@@ -10,6 +10,8 @@
10
10
 
11
11
 
12
12
 
13
+
14
+
13
15
  /etc/systemd/system/test.service
14
16
 
15
17
  上記ファイルを作成し、ファイルの内容は下記のとおりです。
@@ -392,7 +394,9 @@
392
394
 
393
395
  ```
394
396
 
395
-
397
+ 最初は動いていたのですが、stop,disnableや killall pythonを繰り返していたら
398
+
399
+ 起動しなくなりました。
396
400
 
397
401
  この後どのようにしたら自動実行できますでしょうか?
398
402
 
@@ -417,3 +421,15 @@
417
421
  pi 2071 0.0 0.2 4220 2116 pts/0 R+ 16:43 0:00 ps u
418
422
 
419
423
  ```
424
+
425
+ rc.localへの記述でも実行されませんでした。
426
+
427
+ ```
428
+
429
+ sudo python /home/pi/nas_all/test013.py
430
+
431
+
432
+
433
+ exit 0
434
+
435
+ ```

1

プロセスの追記

2017/09/15 07:59

投稿

nagog
nagog

スコア16

test CHANGED
File without changes
test CHANGED
@@ -397,3 +397,23 @@
397
397
  この後どのようにしたら自動実行できますでしょうか?
398
398
 
399
399
  ご教示願います。
400
+
401
+
402
+
403
+ また、startで実行したときは実行できているのですが、プロセスで見れないのはなぜでしょうか?
404
+
405
+
406
+
407
+ ```
408
+
409
+ pi@raspberrypi:~ $ ps u
410
+
411
+ USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
412
+
413
+ pi 827 0.0 0.4 6092 4472 tty1 S+ 16:20 0:00 -bash
414
+
415
+ pi 2042 0.6 0.4 5960 4388 pts/0 Ss 16:43 0:00 /bin/bash
416
+
417
+ pi 2071 0.0 0.2 4220 2116 pts/0 R+ 16:43 0:00 ps u
418
+
419
+ ```