service file templating
This commit is contained in:
parent
a00275bebd
commit
2afb1851d6
2 changed files with 6 additions and 3 deletions
5
Makefile
5
Makefile
|
@ -24,7 +24,10 @@ build: deps
|
||||||
&& export CGO_ENABLED=0 \
|
&& export CGO_ENABLED=0 \
|
||||||
&& go build -v -mod=vendor -ldflags $(BUILD_FLAGS) -o ${BINARY} ./cli/main.go
|
&& go build -v -mod=vendor -ldflags $(BUILD_FLAGS) -o ${BINARY} ./cli/main.go
|
||||||
|
|
||||||
install: build
|
neo-go.service: neo-go.service.template
|
||||||
|
@sed -r -e 's_BINDIR_$(BINDIR)_' -e 's_UNITWORKDIR_$(UNITWORKDIR)_' -e 's_SYSCONFIGDIR_$(SYSCONFIGDIR)_' $< >$@
|
||||||
|
|
||||||
|
install: build neo-go.service
|
||||||
@echo "=> Installing systemd service"
|
@echo "=> Installing systemd service"
|
||||||
@mkdir -p $(DESTDIR)$(SYSCONFIGDIR)/neo-go \
|
@mkdir -p $(DESTDIR)$(SYSCONFIGDIR)/neo-go \
|
||||||
&& mkdir -p $(SYSTEMDUNIT_DIR) \
|
&& mkdir -p $(SYSTEMDUNIT_DIR) \
|
||||||
|
|
|
@ -4,7 +4,7 @@ Requires=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
ExecStart=/usr/bin/neo-go node --mainnet --config-path=/etc/neo-go
|
ExecStart=BINDIR/neo-go node --mainnet --config-path=SYSCONFIGDIR/neo-go
|
||||||
User=neo-go
|
User=neo-go
|
||||||
Group=neo-go
|
Group=neo-go
|
||||||
Restart=always
|
Restart=always
|
||||||
|
@ -12,7 +12,7 @@ RestartSec=5
|
||||||
StandardError=syslog
|
StandardError=syslog
|
||||||
SyslogIdentifier=neo-go
|
SyslogIdentifier=neo-go
|
||||||
PrivateTmp=true
|
PrivateTmp=true
|
||||||
WorkingDirectory=/var/lib/neo-go
|
WorkingDirectory=UNITWORKDIR
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
Loading…
Reference in a new issue