Enable systemd-time-wait-sync.service in rootfs image

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Enable systemd-time-wait-sync.service in rootfs image

ソリューションへジャンプ
2,357件の閲覧回数
dvlogic
Contributor III

I have a service that requires time being set.  By googling around I found that the "systemd-time-wait-sync.service" is responsible for letting the system know when time is set.  

I have a systemd service with the following unit requirements:

[Unit]
Description=My Service
After=network-online.target
After=time-sync.target
Wants=time-sync.target

I see that the systemd-time-wait-sync service is installed but its not enabled.  If I don't have systemd-time-wait-sync.service enabled, my service runs even if time is not set (and for that matter network isn't online).  However, if I manually enable the systemd-time-wait-sync.service, my service works and will not run until time is actually set, after we get the network online.

How do I make the systemd-time-wait-sync.service enabled at install time? (e.g. automatically create the symbolic link to the /etc/systemd/system/sysinit.target.wants?

Thanks.

0 件の賞賛
返信
1 解決策
2,353件の閲覧回数
dvlogic
Contributor III

Never mind, I figured it out.  I had to add a "Wants=systemd-time-wait-sync.service" to my service Unit settings.  

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
2,342件の閲覧回数
b36401
NXP Employee
NXP Employee

Thanx for letting us know. I'm closing the case.

0 件の賞賛
返信
2,354件の閲覧回数
dvlogic
Contributor III

Never mind, I figured it out.  I had to add a "Wants=systemd-time-wait-sync.service" to my service Unit settings.  

0 件の賞賛
返信