> On 7 Apr 2022, at 21:22, olivares33561 via users 
> <users@lists.fedoraproject.org> wrote:
> 
> Sent from ProtonMail, encrypted email based in Switzerland.
> 
> 
> 
> I am getting closer.
> 
> [olivares@fedora user]$ cat poweroff.service
> # /etc/systemd/system/poweroff.service
> [Unit]
> Description = Poweroff machine at 16:20 PM Mo-Fri
> 
> [Service]
> Type=oneshot
> #ExecStart=~/bin/poweroff.sh
> ExecStart=/usr/bin/sudo /usr/bin/systemctl --no-block poweroff.service

To power down the system you can use the command

     /usr/bin/systemctl poweroff

See man systemctl for the details of what this does.

Barry



> [olivares@fedora user]$ cat poweroff.timer
> # /etc/systemd/system/poweroff.timer
> [Unit]
> Description=Poweroff machine at 4:20 PM Mo-Fri
> 
> [Timer]
> OnCalendar=Mon..Fri *-*-* 16:20:00
> Persistent=true
> 
> [Install]
> WantedBy=timers.target
> 
> I get the following error message:
> 
> [olivares@fedora user]$ systemctl --user enable poweroff.service
> The unit files have no installation config (WantedBy=, RequiredBy=, Also=,
> Alias= settings in the [Install] section, and DefaultInstance= for template
> units). This means they are not meant to be enabled using systemctl.
> 
> Possible reasons for having this kind of units are:
> • A unit may be statically enabled by being symlinked from another unit's
>  .wants/ or .requires/ directory.
> • A unit's purpose may be to act as a helper for some other unit which has
>  a requirement dependency on it.
> • A unit may be started when needed via activation (socket, path, timer,
>  D-Bus, udev, scripted systemctl call, ...).
> • In case of template units, the unit is meant to be enabled with some
>  instance name specified.
> [olivares@fedora user]$
> 
> Thank you all for helping me.
> 
> Best Regards,
> 
> 
> Antonio
> _______________________________________________
> users mailing list -- users@lists.fedoraproject.org
> To unsubscribe send an email to users-le...@lists.fedoraproject.org
> Fedora Code of Conduct: 
> https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: 
> https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
> Do not reply to spam on the list, report it: 
> https://pagure.io/fedora-infrastructure
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to