open-wether / build /openmeteo-api2.service
soiz1's picture
Migrated from GitHub
6ee917b verified
raw
history blame contribute delete
699 Bytes
[Unit]
Description = Run Open-Meteo API, second process
StartLimitIntervalSec=0
[Service]
EnvironmentFile=/etc/default/openmeteo-api.env
PassEnvironment=VAPOR_ENV API_SYNC_APIKEYS NGINX_SENDFILE_PREFIX LOG_LEVEL CACHE_DIRECTORY SWIFT_BACKTRACE
Type=simple
User=openmeteo-api
Group=openmeteo-api
WorkingDirectory=/var/lib/openmeteo-api/
ExecStart=/usr/local/bin/openmeteo-api serve -b $API_BIND2 --env $VAPOR_ENV
ExecStopPost=/bin/bash -c 'if [[ "$$EXIT_STATUS" != 0 && -n "$API_BIND2" ]]; then /usr/local/bin/openmeteo-notify.sh $NOTIFICATION_EMAIL %N; fi'
Restart=always
RestartSec=1
LimitNOFILE=infinity
ExecCondition=/bin/bash -c '/bin/test -n "$API_BIND2"'
[Install]
WantedBy = default.target