Hexo systemD unit file

is time to be a bash scripting....
ლ(¯ロ¯"ლ)
Post Reply
User avatar
Kosmito
Site Admin
Posts: 17
Joined: Mon Jan 09, 2023 7:16 pm
Contact:

Hexo systemD unit file

Post by Kosmito »

Hexo is a simple, lightweight node blog framework. It didn’t include a SystemD Unit file, so I created one:

Hexo SystemD Unit File

Create the next file on this location

Code: Select all

 # cd /etc/systemd/system/

Code: Select all

[Service]
WorkingDirectory=/home/YOURDOMAIN/FOLDER WHERE IS INSTALLED
ExecStart=/usr/local/bin/hexo server
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=hexo
User=REPLACE WITH YOUR USER
Group=REPLACE WITH YOUR USER
Environment=NODE_ENV=production

[Install]
WantedBy=multi-user.target
in some case you need to reload the daemon

Code: Select all

# systemctl daemon-reload
and start the service with

Code: Select all

# systemctl start hexo
if everything go well you are not to see any errors you can check is running with

Code: Select all

# systemctl status hexo
is going to be like this

Code: Select all

● hexo.service
   Loaded: loaded (/etc/systemd/system/hexo.service; disabled; vendor preset: disabled)
   Active: active (running) since Tue 2024-04-02 04:29:50 UTC; 5s ago
 Main PID: 753876 (hexo)
    Tasks: 11 (limit: 12030)
   Memory: 75.0M
   CGroup: /system.slice/hexo.service
           └─753876 hexo
Image
Image
Post Reply