Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gdvalle/mkservice

A CLI tool to create a simple system service.
https://github.com/gdvalle/mkservice

Last synced: about 1 month ago
JSON representation

A CLI tool to create a simple system service.

Awesome Lists containing this project

README

        

# mkservice

A CLI utility to stamp out a basic systemd service.

## Usage

```
USAGE:
mkservice [OPTIONS] [COMMAND]...

ARGS:

...

OPTIONS:
-e, --env
-h, --help Print help information
--level [default: system] [possible values: user, system]
-V, --version Print version information
```

An example:

```
mkservice --env LOG_LEVEL=debug --env SECRET=abc myprogram /usr/local/bin/myprogram -- pos_arg --flag-arg
```

Would write out `/etc/systemd/system/myprogram.service`, reload systemd, and enable the service for start on next boot:

```ini
[Unit]
Description=myprogram
[Install]
WantedBy=multi-user.target
[Service]
Environment=LOG_LEVEL=debug
Environment=SECRET=abc
ExecStart="/usr/local/bin/myprogram" "pos_arg" "--flag-arg"
Type=simple
```