Skip to content

Commit

Permalink
Fixed the Cookbook systemd unit to use Environment= for NODE_ENV
Browse files Browse the repository at this point in the history
ExecStart is not run with /bin/sh, so setting NODE_ENV there doesn't work and
results in: Failed at step EXEC spawning NODE_ENV=production: No such file or
directory.

Setting NODE_ENV in an Environment="" fixes this.
  • Loading branch information
zerodogg committed Apr 26, 2024
1 parent c254e77 commit ba5c49e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/Cookbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ After=network.target
[Service]
Type=simple
User=sri
ExecStart=NODE_ENV=production node /home/sri/myapp/myapp.js server -l http://*:8080
Environment="NODE_ENV=production"
ExecStart=node /home/sri/myapp/myapp.js server -l http://*:8080
[Install]
WantedBy=multi-user.target
Expand All @@ -136,7 +137,7 @@ You can even use systemd for
your server as file descriptor `3`, so all you have to do is to use a slightly different listen option.

```
ExecStart=NODE_ENV=production node /home/sri/myapp/myapp.js server -l http://*?fd=3
ExecStart=node /home/sri/myapp/myapp.js server -l http://*?fd=3
```

### Reloading
Expand Down

0 comments on commit ba5c49e

Please sign in to comment.