页次: 1
Question:
1.我想使用Systemd Service来执行一个自动更新系统(Pacman)的脚本 日志显示在选择Y/n时会报错
2.我想让它安全执行完(比如执行完成才退出)
谢谢您的帮助:0
log:
Oct 03 22:11:38 archlinux bash[3160]: Updating System Don't poweroff
Oct 03 22:11:38 archlinux sudo[3162]: root : PWD=/ ; USER=root ; COMMAND=/usr/bin/pacman -Syyu
Oct 03 22:11:38 archlinux sudo[3162]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=0)
Oct 03 22:11:38 archlinux bash[3163]: :: Synchronizing package databases...
Oct 03 22:11:40 archlinux bash[3163]: core downloading...
Oct 03 22:11:40 archlinux bash[3163]: extra downloading...
Oct 03 22:11:40 archlinux bash[3163]: community downloading...
Oct 03 22:11:40 archlinux bash[3163]: multilib downloading...
Oct 03 22:11:40 archlinux bash[3163]: :: Starting full system upgrade...
Oct 03 22:11:41 archlinux bash[3163]: resolving dependencies...
Oct 03 22:11:41 archlinux bash[3163]: looking for conflicting packages...
Oct 03 22:11:41 archlinux bash[3163]: Packages (1) v2ray-domain-list-community-20221003054842-1
Oct 03 22:11:41 archlinux bash[3163]: Total Download Size: 0.14 MiB
Oct 03 22:11:41 archlinux bash[3163]: Total Installed Size: 1.36 MiB
Oct 03 22:11:41 archlinux bash[3163]: Net Upgrade Size: 0.00 MiB
Oct 03 22:11:41 archlinux sudo[3162]: pam_unix(sudo:session): session closed for user root
Oct 03 22:11:41 archlinux bash[3163]: :: Proceed with installation? [Y/n]
Oct 03 22:11:41 archlinux systemd[1]: update.service: Main process exited, code=exited, status=1/FAILURE
Oct 03 22:11:41 archlinux systemd[1]: update.service: Failed with result 'exit-code'.
update.service:
[Unit]
Description=update
[Service]
ExecStart=bash /update.sh
[Install]
WantedBy=multi-user.target
update.sh:
#!/bin/bash
echo "Updating System Don't poweroff"
sudo pacman -Syyu
离线
谢谢 感谢你的帮助 现在它确实达到我的目标
万分感谢
离线
页次: 1