<div dir="ltr"><div>Greetings,</div><div><br></div><div>I have phone that I plug into my computer and have a udev rule to fire off a systemd service. Things work well, but the journal indicates that the command isn't terminating cleanly.</div><div><br></div><div>Here is the udev rules. Added for completeness:</div><div><div>% cat /etc/udev/rules.d/90-galaxy-note-3.rules</div><div># Download photos from Galaxy Note 3</div><div>ACTION=="add" \</div><div>ENV{ID_MTP_DEVICE}=="1" \</div><div>ENV{ID_VENDOR_ID}=="04e8" \</div><div>ENV{ID_MODEL_ID}=="6860" \</div><div>ENV{ID_SERIAL_SHORT}=="17b765cc" \</div><div>TAG+="systemd" \</div><div>PROGRAM="/bin/systemd-escape --template=download-photos@.service $env{ID_SERIAL}" \</div><div>ENV{SYSTEMD_USER_WANTS}+="%c"</div></div><div><br></div><div>Here is my unit file with a minimal ExecStart that exhibits the problem:</div><div><br></div><div>% cat ~/.config/systemd/user/download-photos@.service<br></div>[Service]<br><div>Type=oneshot<br></div><div>ExecStart=/usr/bin/mate-terminal --command '/bin/cat /dev/null'<br></div><div><br></div><div>Here is the same command executed from a (secondary) terminal:</div><div><br></div><div>/usr/bin/mate-terminal --command '/bin/cat /dev/null'<br></div><div>echo $?</div><div>0</div><div><br></div><div>However here is the journal when I plug in the phone:</div><div><br></div><div><div>Oct 31 10:53:54 eruke systemd[1274]: Starting download-photos@SAMSUNG_SAMSUNG_Android_17b765cc.service...</div><div>Oct 31 10:53:55 eruke systemd[1274]: download-photos@SAMSUNG_SAMSUNG_Android_17b765cc.service: Main process exited, code=exited, status=255/n/a<br></div><div>Oct 31 10:53:55 eruke systemd[1274]: download-photos@SAMSUNG_SAMSUNG_Android_17b765cc.service: Failed with result 'exit-code'.</div><div>Oct 31 10:53:55 eruke systemd[1274]: Failed to start download-photos@SAMSUNG_SAMSUNG_Android_17b765cc.service.</div></div><div><br></div><div>When I replace "/bin/cat /dev/null" with the actual script to download photos from the phone I get the same error in the journal. The downloading script does the job (I get the photos downloaded and the correct output is in the mate-terminal that systemd spawned) so it is "succeeding", but I keep getting "Failed" in the journal due to the 'exit-code'.</div><div><br></div><div>This issue seems related to the ExecStart having '/usr/bin/mate-terminal'. If I instead use</div><div><br></div><div>ExecStart=/bin/cat /dev/null</div><div><br></div><div>in the unit, then I do not get the "Failed with result 'exit-code'" message in the journal, so the evidence is pointing at the mate-terminal interaction with systemd.</div><div><br></div><div>Does anyone have any ideas how systemd is interacting (killing?) with the mate-terminal?</div><div><br></div><div>Thanks for any pointers!</div><div><br></div><div>-m</div></div>