Systemd:このデバイスに何の問題がありますか? [コピー]

Systemd:このデバイスに何の問題がありますか? [コピー]

私はこのユニット()を書いた:/etc/systemd/system/[email protected]

[Unit]
Description=TEST (%I)

[Service]
ExecStart=/bin/echo "%i %I" >> /home/vagrant/test.txt

[Install]
WantedBy=multi-user.target

実行systemctl enable test@後、systemctl start 'test@slug=test phone=999999999999'ファイルはまったく表示されません/home/vagrant

出力はsystemctl status 'test@slug=test phone=999999999999'次のとおりです

● test@slug\x3dtest\x20phone\x3d99999999999.service - TEST (slug=test phone=99999999999)
   Loaded: loaded (/etc/systemd/system/[email protected]; disabled; vendor preset: enabled)
   Active: inactive (dead)

May 01 15:40:51 vagrant-ubuntu-wily-32 systemd[1]: Started TEST (slug=test phone=99999999999).
May 01 15:40:51 vagrant-ubuntu-wily-32 echo[2161]: slug\x3dtest\x20phone\x3d99999999999 slug=test phone=99999999999 >> /home/vagrant/test.txt

を使用して構文エラーを確認しようとしましたが、出力はです。systemd-analyze verify [email protected]Failed to load [email protected]: Invalid argument

ベストアンサー1

できません>>ExecStartリダイレクトを実行できるシェルを実行または設定する必要がありますStandardOutput=

ExecStart=/bin/bash -c 'echo "%i %I" >> /home/vagrant/test.txt'

おすすめ記事