Ubuntu 18.04.6 LTSは起動後にスクリプトからコマンドを実行します。

Ubuntu 18.04.6 LTSは起動後にスクリプトからコマンドを実行します。

このような欠陥があります。睡眠から目覚めた後、コンピュータ(クロム)から音が消えます。pulseaudio -k端末に命令を入力すると解決します。しかし、毎回入力しないようにスクリプトを作成しました。

#!/bin/bash
pulseaudio -k

私はやった回答しかし、成功しませんでした。ログに次のメッセージが表示されます。

E: [pulseaudio] main.c: The daemon could not shut down: There is no such process

同時にコンソールに次のように入力すると、pulseaudio -kコマンドの実行にエラーはなく、サウンドが表示されます。

私は何が間違っていましたか?

ポリスチレン

ユーザーサービス:

[Unit]
Description=Run my_script_pulse
After=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target
#After=sleep.target

[Service]
#Type=oneshot
#Type=forking
ExecStart=/usr/local/bin/st_pulse
#ExecStart=/home/paul/st_pulse.sh
#User=paul
#Environment=DISPLAY=:0
StandardOutput=file:/home/paul/log_file

[Install]
WantedBy=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target
#WantedBy=sleep.target

ベストアンサー1

おすすめ記事