-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from latchbio/rahuldesai1/restart-sysbox-mgr
Restart Sysbox Services on Failure
- Loading branch information
Showing
4 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[Unit] | ||
Description=sysbox-fs (part of the Sysbox container runtime) | ||
PartOf=sysbox.service | ||
After=sysbox-mgr.service | ||
|
||
[Service] | ||
Type=simple | ||
Type=notify | ||
ExecStart=/usr/bin/sysbox-fs | ||
Restart=always | ||
TimeoutStartSec=10 | ||
TimeoutStopSec=10 | ||
StartLimitInterval=0 | ||
NotifyAccess=main | ||
OOMScoreAdjust=-500 | ||
|
||
# The number of files opened by sysbox-fs is a function of the number of | ||
# containers and the workloads within them. Thus we set the limit to | ||
# infinite so to prevent "too many open files" errors. | ||
LimitNOFILE=infinity | ||
LimitNPROC=infinity | ||
|
||
[Install] | ||
WantedBy=sysbox.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[Unit] | ||
Description=sysbox-mgr (part of the Sysbox container runtime) | ||
PartOf=sysbox.service | ||
|
||
[Service] | ||
Type=simple | ||
Type=notify | ||
ExecStart=/usr/bin/sysbox-mgr | ||
Restart=always | ||
TimeoutStartSec=45 | ||
TimeoutStopSec=90 | ||
StartLimitInterval=0 | ||
NotifyAccess=main | ||
OOMScoreAdjust=-500 | ||
|
||
# The number of files opened by sysbox-mgr is a function of the number of | ||
# containers and the size of the rootfs within them. Thus we set the limit to | ||
# infinite so to prevent "too many open files" errors. | ||
LimitNOFILE=infinity | ||
LimitNPROC=infinity | ||
|
||
[Install] | ||
WantedBy=sysbox.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Sysbox unit to act as a wrapper of sysbox's inner components/daemons: | ||
# sysbox-mgr and sysbox-fs. | ||
|
||
[Unit] | ||
Description=Sysbox container runtime | ||
Documentation=https://github.com/nestybox/sysbox | ||
# rahul: using BindsTo + PartOf prevents the services that are bound | ||
# from restarting on failure. For example, if sysbox-mgr.service is | ||
# killed, sysbox.service will stop because of the 'BindsTo' constraint. | ||
# However, because sysbox-mgr.service is 'PartOf' sysbox.service, | ||
# sysbox-mgr.service will not restart until sysbox.service has started | ||
# BindsTo=sysbox-mgr.service sysbox-fs.service | ||
After=sysbox-mgr.service sysbox-fs.service | ||
|
||
# Must start before Docker/containerd to ensure "docker --restart" works | ||
# properly with Sysbox. | ||
Before=docker.service containerd.service | ||
|
||
[Service] | ||
Type=exec | ||
ExecStart=/bin/sh -c "/usr/bin/sysbox-runc --version && /usr/bin/sysbox-mgr --version && /usr/bin/sysbox-fs --version && /bin/sleep infinity" | ||
Restart=always | ||
|
||
[Install] | ||
# Components of this application should be started at boot time | ||
WantedBy=multi-user.target |