How to change the soft link in target.requires or target.wants directory
CS20 CHLi30
CHLI30 at nuvoton.com
Thu Dec 26 18:46:13 AEDT 2019
Hi Felix,
If you need to add your .service unit file into .want or .requires folder, you can use systemd to do that in .bb file.
You can refer obmc-op-control-power_git.bb this file for example:
Install to .requires folder:
RESET_ON_TMPL = "op-reset-chassis-running at .service"
RESET_ON_INSTFMT = "op-reset-chassis-running@{0}.service"
RESET_ON_FMT = "../${RESET_ON_TMPL}:${RESET_TGTFMT}.requires/${RESET_ON_INSTFMT}"
Install to .want folder:
# Force the standby target to run the chassis reset check target
RESET_TMPL_CTRL = "obmc-chassis-powerreset at .target"
SYSD_TGT = "multi-user.target"
RESET_INSTFMT_CTRL = "obmc-chassis-powerreset@{0}.target"
RESET_FMT_CTRL = "../${RESET_TMPL_CTRL}:${SYSD_TGT}.wants/${RESET_INSTFMT_CTRL}"
SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'RESET_FMT_CTRL', 'OBMC_CHASSIS_INSTANCES')}"
Sincerely,
Tim
-----Original Message-----
From: openbmc [mailto:openbmc-bounces+chli30=nuvoton.com at lists.ozlabs.org] On Behalf Of Lei YU
Sent: Thursday, December 26, 2019 3:37 PM
To: zhang_cy1989 <zhang_cy1989 at 163.com>
Cc: openbmc at lists.ozlabs.org
Subject: Re: How to change the soft link in target.requires or target.wants directory
On Thu, Dec 26, 2019 at 3:18 PM zhang_cy1989 <zhang_cy1989 at 163.com> wrote:
>
> Dear All
> The target.requires or target.wants contains some soft link.
> Ex:
> /lib/systemd/system/obmc-host-startmin at 0.target.requires
> lrwxrwxrwx 1 root root 31 Nov 29 2019 obmc-chassis-poweron at 0.target -> ../obmc-chassis-poweron at .target
> lrwxrwxrwx 1 root root 25 Nov 28 09:51 op-occ-enable at 0.service -> ../op-occ-enable at .service
> lrwxrwxrwx 1 root root 22 Nov 28 09:57 start_host at 0.service -> ../start_host at .service
>
> Now, I want to add or delete soft link:op-occ-enable at 0.service
> I can use "rm -rf ./op-occ-enable at 0.service" to achieve the goal.
> But,I'm not exactly sure this is formal operation. And I'm afraid this will be side effect.
>
> Are there other tools or formal methods to do this?
These links are expected to be managed by systemd.
You could disable or mask the services by `systemctl [disable|mask] <service>`. If you need them later, just enable or unmask them.
________________________________
________________________________
The privileged confidential information contained in this email is intended for use only by the addressees as indicated by the original sender of this email. If you are not the addressee indicated in this email or are not responsible for delivery of the email to such a person, please kindly reply to the sender indicating this fact and delete all copies of it from your computer and network server immediately. Your cooperation is highly appreciated. It is advised that any unauthorized use of confidential information of Nuvoton is strictly prohibited; and any information in this email irrelevant to the official business of Nuvoton shall be deemed as neither given nor endorsed by Nuvoton.
More information about the openbmc
mailing list