Slightly off-topic, but I think it's relevant:

If 'myservice' and 'ods-prx' are referring to the same thing, I think
you're supposed to use 'systemctl preset' instead of 'systemctl enable'.
This allows the admin to decide whether the installed
service/target/timer/etc. should be enabled during package installation. I
recently learned about this feature and am using it to good effect on my
own systems to stop packages from auto-starting the services they install
:-)

On Mon, Feb 7, 2022 at 1:55 PM Barry Scott <ba...@barrys-emacs.org> wrote:

> This is not for a package in Fedora, its for a package I'm
> working on for Oracle Linux 8.
>
> I install /usr/lib/systemd/system/myservice.target
> that has:
>
> [Install]
> WantedBy=multi-user.target
>
> In %post I run this:
>
> ls -l /etc/systemd/system/multi-user.target.wants
> /usr/bin/systemctl --no-reload enable ods-prx.target
> ls -l /etc/systemd/system/multi-user.target.wants
> echo "Info: post done"
>
> When I dnf install myservice I see that the symlink is
> setup from the ls -l output in the %post section.
>
> But later in the output I see this line:
>
> Info: post done
>
>   Running scriptlet: myservice-2022.1-20220207180603.noarch
> Removed /etc/systemd/system/multi-user.target.wants/myservice.target.
>
> Is this expected?
>
> How can I stop this happening?
>
> If its not expected how can I pull apart the RPM to find the code that is
> running?
>
> Barry
>
>
> _______________________________________________
> devel mailing list -- devel@lists.fedoraproject.org
> To unsubscribe send an email to devel-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/devel@lists.fedoraproject.org
> Do not reply to spam on the list, report it:
> https://pagure.io/fedora-infrastructure
>
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-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/devel@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to