Last active
June 28, 2017 16:20
-
-
Save mark-kubacki/506102fbf3025dd143ce9fe6ec99a175 to your computer and use it in GitHub Desktop.
godoc and systemd
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
[Unit] | |
Description=updates Golang's documentation index | |
ConditionFileNotEmpty=!/usr/share/go-1.6/godoc_index.db | |
ConditionACPower=true | |
AssertDirectoryNotEmpty=/usr/share/go-1.6 | |
[Service] | |
Restart=on-failure | |
ExecStart=/usr/bin/godoc \ | |
-goroot /usr/share/go-1.6 \ | |
-index -index_files /usr/share/go-1.6/godoc_index.pre -write_index \ | |
-notes XXX | |
ExecStopPost=/bin/mv /usr/share/go-1.6/godoc_index.pre /usr/share/go-1.6/godoc_index.db | |
PrivateTmp=true | |
ProtectHome=true | |
ProtectSystem=full | |
PrivateDevices=true | |
ReadWriteDirectories=/usr/share/go-1.6 | |
CapabilityBoundingSet= | |
AmbientCapabilities= | |
NoNewPrivileges=true | |
[Install] | |
WantedBy=default.target |
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
[Unit] | |
Description=starts Golang's doc server when the index is ready | |
After=godoc-create-index.service | |
[Path] | |
PathExists=/usr/share/go-1.6/godoc_index.db | |
[Install] | |
WantedBy=multi-user.target |
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
[Unit] | |
Description=shows Golang's documentation | |
After=network-online.target godoc-update-index.service | |
Wants=network-online.target godoc-update-index.service | |
ConditionFileNotEmpty=|/usr/share/go-1.6/godoc_index.db | |
ConditionACPower=|true | |
[Service] | |
Restart=on-failure | |
Environment=GOMAXPROCS=2 | |
User=nobody | |
Group=nogroup | |
ExecStart=/usr/bin/godoc -http=:6060 \ | |
-goroot /usr/share/go-1.6 \ | |
-index -index_files=/usr/share/go-1.6/godoc_index.db \ | |
-notes XXX | |
ExecReload=/bin/kill -USR1 $MAINPID | |
PrivateTmp=true | |
ProtectHome=true | |
ProtectSystem=full | |
PrivateDevices=true | |
ReadWriteDirectories=/usr/share/go-1.6 | |
;CapabilityBoundingSet=CAP_NET_BIND_SERVICE | |
;AmbientCapabilities=CAP_NET_BIND_SERVICE | |
CapabilityBoundingSet= | |
AmbientCapabilities= | |
NoNewPrivileges=true | |
[Install] | |
WantedBy=multi-user.target | |
Also=godoc.path | |
Also=godoc-create-index.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
systemctl daemon-reload systemctl enable godoc-create-index.service godoc.path systemctl start godoc-create-index.service godoc.path