Add basic support for systemd (#761)

This commit is contained in:
Lucas 2023-07-26 14:06:57 +08:00 committed by GitHub
parent 695215853a
commit 09a47e0beb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 54 additions and 0 deletions

31
debian/config.yaml vendored Normal file
View File

@ -0,0 +1,31 @@
# Connection keep alive timeout [default: 75]
keep_alive: 75
# The socket address to bind [default: 0.0.0.0:3000]
listen_addresses: '0.0.0.0:3000'
# Number of web server workers
worker_processes: 8
# see https://maplibre.org/martin/config-file.html
# postgres:
# connection_string: 'postgresql://postgres@localhost:5432/db'
# default_srid: 4326
# pool_size: 20
# max_feature_count: 1000
# disable_bounds: false
# pmtiles:
# paths:
# - /dir-path
# - /path/to/pmtiles.pmtiles
# sources:
# pm-src1: /path/to/pmtiles1.pmtiles
# mbtiles:
# paths:
# - /dir-path
# - /path/to/mbtiles.mbtiles
# sources:
# mb-src1: /path/to/mbtiles1.mbtiles

8
debian/martin.service vendored Normal file
View File

@ -0,0 +1,8 @@
[Unit]
Description = A blazing fast map tile server which can generate and serve vector tiles on the fly from large PostGIS databases, PMTile, and MBTile files
[Service]
ExecStart = /usr/bin/martin --config /usr/local/etc/martin/config.yaml
[Install]
WantedBy = multi-user.target

View File

@ -20,6 +20,21 @@ homepage.workspace = true
name = "martin" name = "martin"
maintainer = "Stepan Kuzmin <to.stepan.kuzmin@gmail.com>, Yuri Astrakhan <YuriAstrakhan@gmail.com>, MapLibre contributors" maintainer = "Stepan Kuzmin <to.stepan.kuzmin@gmail.com>, Yuri Astrakhan <YuriAstrakhan@gmail.com>, MapLibre contributors"
depends = "$auto" depends = "$auto"
maintainer-scripts = "../debian"
assets = [
["target/release/martin", "/usr/bin/martin", "755"],
["../README.md","/usr/share/doc/martin/README.md","644"],
["../debian/config.yaml", "/usr/share/doc/martin/config.yaml", "644"],
["../debian/config.yaml", "/usr/local/etc/martin/config.yaml", "644"],
]
# see https://github.com/kornelski/cargo-deb/blob/main/systemd.md#packagemetadatadebsystemd-units-options
[package.metadata.deb.systemd-units]
unit-scripts = "../debian/"
enable = false
start = false
restart-after-upgrade = false
stop-on-upgrade = true
[lib] [lib]
path = "src/lib.rs" path = "src/lib.rs"