I am fairly new to BusyBox and has previously worked with systemd
as init
system. Now I want to switch to BusyBox as init system. I am using Buildroot tool develop custom linux distribution. I have bunch of systemd service and timer files and they run at certain interval to trigger some actions. But now I have to adapt it to BusyBox scripts to obtain similar behavior. I couldn't find any example/manual to demonstrate how this can be done. And also I wanted to know if cron
or anacron
could be used to schedule these executions and what are the downsides to it? Below I have added some systemd service and timer files as reference and I would like to know how this could be converted to BusyBox compatible. This would be the starting point for me to continue further.
example.service
[Unit]
Description=Test
After=network.target
[Service]
User=root
Environment="x=/etc/xx.cnf"
ExecStartPre=/bin/ping www.google.com
ExecStart=/usr/bin/example
WorkingDirectory=/mnt/test/
TimeoutStartSec=20m
Restart=on-failure
RestartSec=2m
[Install]
WantedBy=multi-user.target
example.timer
[Unit]
Description=Example timer setup
[Timer]
OnActiveSec=1m
OnUnitActiveSec=20m
[Install]
WantedBy=basic.target
Can anyone please let me know how failed jobs are triggered automatically and how Environment
, ExecStartPre
and WorkingDirectory
systemd
variables could be adapted in crontab
file?
If there is any other way in busybox to achieve this, I would be happy to know about it.
Your help will be much appreciated.
Thanks in advance
P.S: Please let me know if any info is missing here