Configure to start JMeter as systemd service

757 views Asked by At

I generally use "nohup" to start Jmeter, Instead of using Cmd all the time, i have decided to configure a systemd service which runs the Jmeter all the time.

i have this below command: which basically run the jmeter and logs the output

nohup /app/jmeter/apache-jmeter-5.3/bin/jmeter -j /app/server-1/jmeter/logs/jmeter-traffic.log -n -t /app/jmeter/inputfile.jmx > /dev/null 2>&1 &

i Have created a .service file which runs the above command on

ExecStart=/app/jemter/apache-jmeter-5.3/bin/jmeter -j /app/jmeter/logs/jmeter-log -n -t /app/jmeter/inputfile.jmx > /dev/null 2>&1 &

when i started the service - i encountered various errors.

EX: class path contains multiple bindings
EX: failed to start the service
EX: failed at step EXEC spawing 
EX: an error occured at arg: > 

Is this the correct way of starting the service or should i be creating the shell script file to include the above command.

1

There are 1 answers

0
Dmitri T On

systemd knows nothing about your > operator so I would recommend leaving the command as it is:

ExecStart=/app/jmeter/apache-jmeter-5.3/bin/jmeter -j /app/jmeter/logs/jmeter-log -n -t /app/jmeter/inputfile.jmx

If you don't want to see JMeter output in the journal you can amend your systemd unit configuration like:

[Service]
StandardOutput=null
StandardError=journal

I would also suggest adding -l command line argument so you could store the results into a .jtl results file for further analysis

More information: How Do I Run JMeter in Non-GUI Mode?