How to Pipe Output to a File When Running as a Systemd Service?

systemd.service(5) says:

ExecStart=

Commands with their arguments that are executed when this service is started.

So, systemd runs your /apppath/appname with args >, /filepath/filename, 2>&1

Try:

ExecStart=/bin/sh -c '/apppath/appname > /filepath/filename 2>&1'

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)