/etc/systemd/system

systemd 服务文件生成器

按 [Unit] / [Service] / [Install] 分段填写,右侧实时生成 unit 文件,附带语法检查提示与部署命令。

About this systemd service file generator

This tool builds a systemd <name>.service unit file from a form, so you do not have to remember the exact spelling and allowed values of every directive. Fill in the [Unit], [Service] and [Install] sections and the file is generated as you type, alongside checks for the mistakes that most often stop a unit from starting.

It covers the directives people actually reach for: Type, the ExecStart family, restart and timeout behaviour, dependency ordering, and a set of sandbox hardening switches such as ProtectSystem, NoNewPrivileges and SystemCallFilter. Three options get extra attention because they are easy to get wrong: DynamicUser=yes allocates a temporary UID instead of requiring a system user, Environment lines are quoted and escaped for you, and StateDirectory and its siblings are checked to be directory names rather than paths.

How to use it

  1. Fill in the form. The unit file updates on the right as you type.
  2. Read the notes under the output. Errors block a working unit; warnings point at settings that usually surprise people.
  3. Copy the file to /etc/systemd/system/<name>.service and run sudo systemctl daemon-reload.
  4. Verify it with sudo systemd-analyze verify <name>.service, then sudo systemctl enable --now <name>.service. The Install commands tab produces this sequence for you.

Everything runs in your browser. There is no account and no backend, and the values you enter are only kept in localStorage on your own machine. The interface is available in English and Chinese.