Essentially what I am trying to understand how to do is to modify some scripts I found to run two simultaneous instances of a service on a Linux Mint machine that I had lying around.

Setting up the first instance of the service I used the instructions found here:


Now I am attempting to take these instructions and alter them to essentially create a second service using the same scripts..

The service will not start and stay that way, though it did prior to a full machine restart. I have placed the second .service file in the same place as the first, '/etc/systemd/system/'. Contents of the service file is below.

Description=server daemon for whim

ExecStart=/usr/bin/screen -dmS whim /bin/bash -c "/opt/terraria/TerrariaServer.bin.x86_64 -config /opt/terraria/whimserverconfig.txt"
ExecStop=/usr/local/bin/whimd exit


Now the reason I restarted the machine in the first place was yet another error. During the course of the instructions here I setup a script for basic administration. It is placed in the same location as the first. '/usr/local/bin/' Contents of the file are below.

#!/usr/bin/env bash

send="`printf \"$*\r\"`"
attach='script /dev/null -qc "screen -r whim"'
inject="screen -S whim-X stuff $send"

if [ "$1" = "attach" ] ; then cmd="$attach" ; else cmd="$inject" ; fi

if [ "`stat -c '%u' /var/run/screen/S-whim/`" = "$UID" ]
    su - whim-c "$cmd"

The problem, before the service ceased to work, was that I could never attach to the screen for the new whim.service.

So my question is this:

Did I go wrong modifying one of these two files or am I missing something even more basic?


You deleted the following whitespace when you changed the names, turning terraria /bin/bash into whim/bin/bash for one example. This made several parts of your service unit and script file wrong.

The whole design seems pretty rickety, running screen as a system-wide service (and the bodges that that entails) in order to run a program that demands that it be interactive as a service, but that is not your doing.

  • My apologies, this was actually the result of a typo I made while transcribing the contents of the file. The issue mentioned in the question remains. – GreatMagusKyros Sep 25 '17 at 20:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.