Systemd - xdm.service file needed [solved]

Anyone using systemd with xdm?  I have been searching the net for a functional service file to start xdm.  Here is what I have but it does not actually start xdm:
$ cat /usr/lib/systemd/system/xdm.service
[Unit]
Description=XDM Display Manager
Requires=dev-tty7.device
After=dev-tty7.device systemd-user-sessions.service
[Service]
ExecStart=/usr/bin/xdm -nodaemon -config /etc/X11/xdm/archlinux/xdm-config
[Install]
WantedBy=graphical.target
EDIT: tried again with the script I entered above and it works just fine.
Last edited by graysky (2012-05-30 20:12:36)

This is a .service file that will work:
[Unit]
Description=Redmine Rainbows Rails server
[Service]
Type=forking
SyslogIdentifier=redmine
User=http
PIDFile=/var/www/redmine/tmp/pids/rainbows.pid
WorkingDirectory=/var/www/redmine
ExecStart=/usr/bin/bundle exec rainbows --host 127.0.0.1 --port 8001 --env production --daemonize --config-file /var/www/redmine/config/rainbows.rb
ExecReload=/bin/kill -HUP $MAINPID
ExecStop=/bin/kill -QUIT $MAINPID
[Install]
WantedBy=multi-user.target
Last edited by wabi (2013-01-03 11:11:38)

Similar Messages

  • /etc/services file needed

    Hi
    Plesae give me contents of /etc/services file on Solaris system which hosts a working Solution Manager 4.0 system on Oracle database.
    This is to compare with my system to solve a problem.
    Thanks
    Ashraf

    Hi Ashraf,
    You need to have the following entries. If you are going to use a SAProuter, you also need 99, as port 3299 is usually used for the SAProuter process on the target system.
    sapdpXX    32XX/tcp # SAP Dispatcher.      3200 + Instance-Number
    sapgwXX    33XX/tcp # SAP Gateway.         3300 + Instance-Number
    sapmsSID   36XX/tcp # SAP Message Server.  3600 + Instance-Number
    sapgwXXs   48XX/tcp # SAP Secure Gateway   4800 + Instance-Number
    Where XX is you instance number,
    Hope ths help!
    Juan
    Please reward with points if helpful

  • Systemd's .service file conflict.

    /usr/lib/systemd/system/irqbalance.service
    conflicts between systemd-arch-units and irqbalance.
    Should I report this as a bug?
    If so, which package should I report?

    No use, really, since the move towards systemd is steady. Go for the systemd service and disable the other one, of need be manually.

  • [solved] writing systemd service file to run script

    i have completely migrated to systemd. now, i am trying to write a service file to run a startup script (~/.startup.sh). one of the functions of the script is to set the brightness of the screen:
    echo "95" > /sys/class/backlight/intel_backlight/brightness
    i created /etc/systemd/system/startup.service:
    [Unit]
    Description=Run startup script
    [Service]
    Type=oneshot
    ExecStart=~/.startup.sh
    [Install]
    WantedBy=multi-user.target
    but i get the following error:
    Failed to issue method call: Unit startup.service failed to load: Invalid argument. See system logs and 'systemctl status startup.service' for details.
    i have two questions:
    1. what am i missing?
    2. how can i avoid permission issues associated with modifying the brightness file (e.g., permission denied errors, the need to put in the password, etc.)?
    thanks.
    Last edited by anti-destin (2012-08-01 22:26:04)

    thanks for the replies.
    just a note: using an absolute path didn't fix the issue.
    but i went ahead and created the file /etc/tmpfiles.d/backlight.conf:
    w /sys/class/backlight/intel_backlight/brightness - - - - 95
    and that worked.
    is there a reason for recommending using a tmpfile rather than a service?
    in any case, i'm marking this as solved.

  • Getting sasc-ng to work properly with systemd service files [SOLVED]

    This thread is intended for getting the following AUR packages to work with each other with systemd service scripts:
    https://aur.archlinux.org/packages/open-sasc-ng-dkms/
    https://aur.archlinux.org/packages/open-sasc-ng/
    https://aur.archlinux.org/packages/oscam-svn/   (this is a related package as it must properly execute prior to sasc-ng)
    So my server is now on a fresh Arch install with systemd. All is well (& very fast) except I cannot get sasc-ng to function with systemd service init files. Prior to systemd the system worked fine with the rc initscripts & was very stable with the following setup:
    rc.local
    /etc/rc.d/oscam start
    sleep 15
    /etc/rc.d/sasc-ng start
    sleep 4
    /etc/rc.d/mythbackend start
    /etc/conf.d/sasc-ng.conf
    SASCNG_ARGS="-j 0:3 -j 1:4 -j 2:5" -b 16M --sid-allpid --sid-nocache --cam-budget"
    DVBLOOPBACK_ARGS="num_adapters=3"
    LOGDIR="/home/mythtv/logs/"
    CAMDIR="/etc/camdir"
    /etc/camdir/cardclient.conf
    camd35:localhost:15050:1/0000/0000:mythtv:mythtv
    I'll leave out the oscam stuff as that loads fine and doesn't appear to be a part of the problem
    I've tried this with the systemd service file that comes with the open-sasc-ng-dkms package and when it was not sucessful I tried a bunch of variants including using "Type=simple" ect. "Type=Forked" seems to be only option that actually tries to start the processes. I also "hardcoded" the service files for the 2 sasc-ng components to find a few issues with the EnvironmentFile variables. The log variable has been removed for now as this seems to cause a fatal error but the rest of the variables load fine now. I also tested spliting up the DVB loopback module from the sasc-ng binary but this also gives similar results as the following script stands now. Running them manually with systemctl start commands doesn't make a difference but that is not surprising. The service file I'm fiddling with now which I feel has the best potential become working is:
    sasc-ng.service
    [Unit]
    Description=Sasc-ng
    After=oscam.service
    [Service]
    Type=forking
    EnvironmentFile=/etc/conf.d/sasc-ng
    ExecStartPre=/sbin/modprobe dvbloopback $DVBLOOPBACK_ARGS
    TimeoutSec=2
    ExecStart=/usr/sbin/sasc-ng -D $SASCNG_ARGS --cam-dir=$CAMDIR
    TimeoutSec=4
    [Install]
    WantedBy=multi-user.target
    Mythbackend always runs fine (even without DTV via sasc-ng) with the following mythbackend.service:
    [Unit]
    Description=MythTV_backend
    After=sasc-ng.service
    [Service]
    Type=simple
    Environment=MYTHCONFDIR=/etc/conf.d/mythbackend
    Environment=HOME=/usr/share/mythtv
    User=mythtv
    ExecStart=/usr/bin/mythbackend --logpath /var/log/mythtv
    [Install]
    WantedBy=multi-user.target
    oscam.service taken mostly from AUR package also seems fine. I added the TimeoutSec=15 to give time for oscam to load the SC and client protocol before moving on or else sasc-ng fails
    Unit]
    Description=An Open Source Conditional Access Module software
    After=network.target
    [Service]
    Type=forking
    EnvironmentFile=/etc/conf.d/oscam
    ExecStart=/usr/bin/oscam $OSCAM_ARGS
    TimeoutSec=15
    [Install]
    WantedBy=multi-user.target
    Below is the output of the systemctl status commands. Despite the noise in the sasc-ng binary status, it is the loopback module that is " inactive (dead)" and there are no virtual DVB devices being created:
    [mythtv@server ~]$ sudo systemctl status oscam.service
    oscam.service - An Open Source Conditional Access Module software
    Loaded: loaded (/usr/lib/systemd/system/oscam.service; enabled)
    Active: active (running) since Tue, 2012-11-27 21:10:17 CET; 1min 7s ago
    Process: 338 ExecStart=/usr/bin/oscam $OSCAM_ARGS (code=exited, status=0/SUCCESS)
    Main PID: 377 (oscam)
    CGroup: name=systemd:/system/oscam.service
    ├ 377 /usr/bin/oscam -b -c /etc/oscam
    └ 378 /usr/bin/oscam -b -c /etc/oscam
    Nov 27 21:10:17 server systemd[1]: Started An Open Source Conditional Acces...e.
    [mythtv@server ~]$ sudo systemctl status loopback.service
    loopback.service - Sasc-ng DVB Loopback Module
    Loaded: loaded (/etc/systemd/system/loopback.service; enabled)
    Active: inactive (dead) since Tue, 2012-11-27 21:10:28 CET; 1min 27s ago
    Process: 907 ExecStart=/sbin/modprobe dvbloopback num_adapters=3 (code=exited, status=0/SUCCESS)
    CGroup: name=systemd:/system/loopback.service
    Nov 27 21:10:28 server systemd[1]: Started Sasc-ng DVB Loopback Module.
    [mythtv@server ~]$ sudo systemctl status sasc-ng.service
    sasc-ng.service - Sasc-ng
    Loaded: loaded (/etc/systemd/system/sasc-ng.service; enabled)
    Active: failed (Result: exit-code) since Tue, 2012-11-27 21:10:47 CET; 1min 45s ago
    Process: 913 ExecStart=/usr/sbin/sasc-ng -D -j 0:3 -j 1:4 -j 2:5" -b 16M --sid-allpid --sid-nocache --cam-budget --cam-dir=/etc/camdir -l /home/mythtv/logs/sasc-ng.log (code=exited, status=0/SUCCESS)
    Main PID: 921 (code=exited, status=255)
    CGroup: name=systemd:/system/sasc-ng.service
    Nov 27 21:10:39 server sasc-ng[921]: [921] [general.error] failed open /etc...ry
    Nov 27 21:10:40 server sasc-ng[921]: [921] [general.error] failed open /etc...ry
    Nov 27 21:10:40 server sasc-ng[921]: [921] [general.error] failed open /etc...ry
    Nov 27 21:10:40 server sasc-ng[921]: [921] [general.info] loading cardclien...nf
    Nov 27 21:10:42 server sasc-ng[921]: [1062] Netwatcher thread started (pid=...6)
    Nov 27 21:10:42 server sasc-ng[921]: [921] [general.error] no keys loaded f...m!
    Nov 27 21:10:46 server sasc-ng[921]: [1098] SC housekeeper thread started (...2)
    Nov 27 21:10:47 server sasc-ng[921]: [1062] Netwatcher thread ended (pid=92...6)
    Nov 27 21:10:47 server systemd[1]: sasc-ng.service: main process exited, co.../a
    Nov 27 21:10:47 server systemd[1]: Unit sasc-ng.service entered failed state
    [mythtv@server ~]$ sudo systemctl status sasc-ng.service
    sasc-ng.service - Sasc-ng
    Loaded: loaded (/etc/systemd/system/sasc-ng.service; enabled)
    Active: failed (Result: exit-code) since Tue, 2012-11-27 21:10:47 CET; 2min 9s ago
    Process: 913 ExecStart=/usr/sbin/sasc-ng -D -j 0:3 -j 1:4 -j 2:5" -b 16M --sid-allpid --sid-nocache --cam-budget --cam-dir=/etc/camdir -l /home/mythtv/logs/sasc-ng.log (code=exited, status=0/SUCCESS)
    Main PID: 921 (code=exited, status=255)
    CGroup: name=systemd:/system/sasc-ng.service
    Nov 27 21:10:39 server sasc-ng[921]: [921] [general.error] failed open /etc/camdir/smartcard.conf: No such file or directory
    Nov 27 21:10:40 server sasc-ng[921]: [921] [general.error] failed open /etc/camdir/cardslot.conf: No such file or directory
    Nov 27 21:10:40 server sasc-ng[921]: [921] [general.error] failed open /etc/camdir/SoftCam.Key: No such file or directory
    Nov 27 21:10:40 server sasc-ng[921]: [921] [general.info] loading cardclient config from /etc/camdir/cardclient.conf
    Nov 27 21:10:42 server sasc-ng[921]: [1062] Netwatcher thread started (pid=921, tid=140074379712256)
    Nov 27 21:10:42 server sasc-ng[921]: [921] [general.error] no keys loaded for softcam!
    Nov 27 21:10:46 server sasc-ng[921]: [1098] SC housekeeper thread started (pid=921, tid=140074371319552)
    Nov 27 21:10:47 server sasc-ng[921]: [1062] Netwatcher thread ended (pid=921, tid=140074379712256)
    Nov 27 21:10:47 server systemd[1]: sasc-ng.service: main process exited, code=exited, status=255/n/a
    Nov 27 21:10:47 server systemd[1]: Unit sasc-ng.service entered failed state
    [mythtv@server ~]$
    Any ideas?
    Last edited by wdirksen (2012-12-10 19:54:43)

    After some head scratching it seems to be all good now. Considering there have been no replies to this I've come to wonder if I might be the only one with this issue. I could get it working somewhat using service files but never ideal, ex. sasc-ng only using a few of the entitlements from oscam because it started too quick etc. Anyway this might help a few and I'm hoping the linux savvy who find what I'm writing here painfully newbie like or flawed will reply and educate me a bit if what's provided here needs some sharpening up:
    1) Systemd was confusing the sasc-ng binary shorthand arguments with Linux init arguments and a few were misinterpreted if they were not nested into the environment specifiers. So the -l (log) was causing problems and -b (buffer) wasn't loading. To be safe I'm using only the sasc-ng longhand specifiers from now on (two "--" and more verbose) so that they can never be confused even if safely nested in an environment parameter. That means that /etc/conf.d/sasc-ng will also need to be changed to reflect this. I also decided to simplify the LOGFILE parameter to include the whole argument syntax.
    2) Oscam.service needs to be initiated with oneshot and RemainAfterExit=yes to make sure the delay (15 seconds in my config) gets counted out before sasc-ng initiates.
    [EDIT 12/12/2012: Initially I had a second TimeoutSec=2 after ExecStart in sasc-ng.service but this had no function. Turns out that it almost always does work without this delay but not always with my setup. Adding TimeoutSec=2 to mythbackend.service prior to ExecStart command does function and makes things init more consistant]
    sasc-ng.service
    [Unit]
    Description=Sasc-ng
    After=oscam.service
    [Service]
    Type=simple
    EnvironmentFile=/etc/conf.d/sasc-ng
    ExecStartPre=/sbin/modprobe dvbloopback $DVBLOOPBACK_ARGS
    TimeoutSec=2
    ExecStart=/usr/sbin/sasc-ng $SASCNG_ARGS --cam-dir $CAMDIR --log $LOGFILE
    [Install]
    WantedBy=multi-user.target
    /etc/conf.d/sasc-ng
    SASCNG_ARGS="--join 0:3 --join 1:4 --join 2:5 --buffer 16M --sid-allpid --sid-nocache --cam-budget"
    DVBLOOPBACK_ARGS="num_adapters=3"
    LOGFILE="/home/mythtv/logs/sasc-ng.log"
    CAMDIR="/etc/camdir"
    oscam.service
    [Unit]
    Description=An Open Source Conditional Access Module software
    After=network.target
    [Service]
    Type=oneshot
    EnvironmentFile=/etc/conf.d/oscam
    ExecStart=/usr/bin/oscam $OSCAM_ARGS
    TimeoutSec=15
    RemainAfterExit=yes
    [Install]
    WantedBy=multi-user.target
    mythbackend.service
    [Unit]
    Description=MythTV_backend
    After=sasc-ng.service
    [Service]
    Type=simple
    TimeoutSec=2
    Environment=MYTHCONFDIR=/etc/conf.d/mythbackend
    Environment=HOME=/usr/share/mythtv
    User=mythtv
    ExecStart=/usr/bin/mythbackend --logpath /var/log/mythtv
    [Install]
    WantedBy=multi-user.target
    I will make the related changes to the open-sasc-ng AUR package which I currently maintain
    Last edited by wdirksen (2012-12-23 14:40:43)

  • [SOLVED] Trying to write HLDS systemd service file

    Hey,
    I want to write a systemd service file for my HLDS AUR package: https://aur.archlinux.org/packages/hlds/
    My environment file looks like this:
    HLDS_USER=root
    HLDS_WORKINGDIR=/opt/hlds
    HLDS_PARAMS="-game cstrike"
    HLDS_LOGFILE=/var/log/hlds_cstrike
    The service file like this:
    After=network.target
    [Service]
    #EnvironmentFile=/etc/conf.d/hlds
    #User=${HLDS_USER}
    #WorkingDirectory=${HLDS_WORKINGDIR}
    ExecStart=/opt/hlds/hlds_run -game cstrike
    ExecStop=/bin/kill $MAINPID
    [Install]
    WantedBy=multi-user.target
    But systemd fails to start the service:
    hlds.service - Half-Life Dedicated Server
              Loaded: loaded (/usr/lib/systemd/system/hlds.service; disabled)
              Active: failed (Result: exit-code) since Thu, 2013-01-03 06:20:49 CET; 2s ago
             Process: 567 ExecStop=/bin/kill $MAINPID (code=exited, status=1/FAILURE)
             Process: 564 ExecStart=/opt/hlds/hlds_run -game cstrike (code=killed, signal=INT)
              CGroup: name=systemd:/system/hlds.service
    Jan 03 06:20:49 playground systemd[1]: Starting Half-Life Dedicated Server...
    Jan 03 06:20:49 playground systemd[1]: Started Half-Life Dedicated Server.
    Jan 03 06:20:49 playground hlds_run[564]: Invalid game type 'cstrike' sepecified.
    Jan 03 06:20:49 playground hlds_run[564]: Thu Jan  3 06:20:49 CET 2013: Server Failed
    Jan 03 06:20:49 playground kill[567]: usage: kill [ -s signal | -p ] [ -a ] pid ...
    Jan 03 06:20:49 playground kill[567]: kill -l [ signal ]
    Jan 03 06:20:49 playground systemd[1]: Unit hlds.service entered failed state
    Running
    /opt/hlds/hlds_run -game cstrike
    manually works quote well
    Someone knows how to proceed? Thanks
    Last edited by onny (2013-01-03 05:43:49)

    Solved. It didn't recognized the workingdir correctly ...

  • [solved] Writing systemd service file - forking no pidfile

    Hey all,
    I am trying to write .service files for TORQUE, but am having some difficulty and quite can't understand the docs.  Here's what I have so far for the server
    [Unit]
    Description=TORQUE server
    Wants=basic.target
    After=basic.target network.target
    [Service]
    Type=forking
    PIDFile=/run/torque-server.pid
    ExecStart=/usr/sbin/pbs_server
    [Install]
    WantedBy=multi-user.target
    The problem I'm having is with the PIDFile - pbs_server doesn't provide an option (as far as I can see) to specify a pid file... is this something that systemd can generate on its own, or what's the normal solution here?
    Without the PIDFile specified systemctl start returns immediately and no process exists, with the PIDFile systemctl start stalls for a while and then has an error saying it couldn't find the pid file (surprise), but pbs_server is left running.
    Thanks for any help
    Last edited by dandaman0061 (2012-12-13 19:58:36)

    Nevermind - it appears that pbs_server creates a pid file at $TORQUE_HOME/server_priv/server.lock where using torque from the AUR is /var/spool/torque
    Chaging the pidfile setting in the service file to this now works.

  • [solved] systemd service files don't allow quotes

    Why is it not possible to use quotes in
    ExecStart=
    section of systemd service files?
    For example, I can't use service file like this
    [Unit]
    Description=Pacman mirrorlist update
    [Service]
    Type=oneshot
    ExecStart=wget -O /etc/pacman.d/mirrorlist.backup "https://www.archlinux.org/mirrorlist/?country=DE&country=NL&country=PL&protocol=http&ip_version=4" && cp /etc/pacman.d/mirrorlist.backup /etc/pacman.d/mirrorlist && reflector --verbose -l 50 -p http --sort rate --save /etc/pacman.d/mirrorlist
    because systemd will not run it because of presence of quotes:
    Feb 26 08:48:36 nanoBox systemd[1]: [/etc/systemd/system/reflector.service:7] Executable path is not absolute, ignoring: wget -O /etc/pacman.d/mirrorlist.backup "URL=http...
    Feb 26 08:48:36 nanoBox systemd[1]: reflector.service lacks both ExecStart= and ExecStop= setting. Refusing.
    I can remove quotes and then the service will run, but the URL parsed to the command will be cut in half, ie it will stop on the first "&" sign and only DE mirrors will be probed.
    Is there some way around it other than creating a separate executable file and calling it from the service? I don't want to multiply unnecessary files if there's way around it.
    Last edited by Lockheed (2015-02-26 09:37:25)

    Lockheed wrote:
    Raynman wrote:"from command line" is you feeding a (command) string to a shell. Your assumption is that systemd will treat whatever you put in ExecStart exactly the same as your shell would.
    Not "is" but "was". Disappearance of that assumption was precisely the reason of starting this thread.
    I had to read this a few times, but I think you mean it as follows. You assumed you could copy from the shell to the service file and it would work the same way. Then you got an error (about the abolute path) so that assumption "disappeared". So far so good. But you didn't exactly figure out what was different, you formed a new assumption and based your thread on that:
    "systemd service files don't allow quotes" (title)
    "Why is it not possible to use quotes in ExecStart= section of systemd service files"
    "because systemd will not run it because of presence of quotes:"
    Like frank604 says, quotes were never the issue (in fact, they are one of the few things with special meaning for both the shell and systemd), yet you still seem to think they were:
    Lockheed wrote wrote:The actual wrong assumption on my part was that this command would run without quotes as service. It does not.
    It is a shame you only quote the first part of my last reply and ignore the questions in the second part. You did almost the same thing with my reply before that and I suspect you also didn't read the man page I mentioned the first time. You basically give me the impression that you think you have it all figured out (even though you come here looking for help) and my follow-up questions aren't worth your time. That usually makes me "move along" pretty quickly, but I'm trying one last time, because even though "The service now works", I'd like to see that you actually understand why it didn't work before.
    The only thing you really answered was "Changing paths to absolute made no difference.", but that shouldn't be, so when you mentioned empirical evidence, I basically repeated the question asking for some of this evidence (as in exact error messages for one or more modified ExecStart lines).
    When I take your service file and give wget an absolute path, systemd happily executes wget, but then wget complains because it gets "&&" and "cp" and "--save" etc. as arguments. Those errors are what I see in systemctl status/journal, no longer anything about an absolute path. This is because "&&" has no special meaning. You can use semicolons (";") to separate commands instead (explained in the man page section on command lines) or multiple ExecStart lines like frank604 used (which is cleaner IMO).

  • [Solved] Make systemctl find .service file in /usr/lib/systemd/user?

    I thought this had always worked, but it seems that systemctl cannot see `.service` files that are in my `/usr/lib/systemd/user` folder and I can't figure out why:
    $ locate redshift-gtk.service
    /usr/lib/systemd/user/redshift-gtk.service
    $ systemctl status redshift-gtk
    ● redshift-gtk.service
    Loaded: not-found (Reason: No such file or directory)
    Active: inactive (dead)
    I have already looked at https://wiki.archlinux.org/index.php/Systemd/User which seems to tell me to check sytemctl --user status but that appears to be loaded and working fine, I have a feeling I'm missing something obvious but can't figure out what it is. How do I make systemctl include this directory?
    $ systemctl --user status
    ● michael-work
    State: running
    Jobs: 0 queued
    Failed: 0 units
    Since: Tue 2014-08-05 11:24:32 BST; 11min ago
    CGroup: /user.slice/user-1000.slice/[email protected]
    ├─730 /usr/lib/systemd/systemd --user
    └─731 (sd-pam)
    Any ideas?
    Last edited by crashandburn4 (2014-08-05 11:09:45)

    systemctl --user status redshift-gtk.service

  • [SOLVED] Systemd service files: sourcing other service files?

    Is there a way to "source" one systemd service file from another, so that the service inherits all settings from the other file? The purpose would be to override or append select fields as a quasi-patch of the other file, e.g.
    <source foo.service>
    [section]
    key=new_value
    I was sure that I had seen this somewhere, but I can't find it. Did I make this up, or is my search-fu simply weak?

    I don't know that it is actually documented at this point in time.  At least I haven't seen any.  The only reason I know about it is beacuse I subscribe to [systemd-devel].  But it was briefly touched on in the announcement when it was first introduced. 
    I know that the .include method is documented very briefly in one of the man pages, but it doesn't really go into depth about how to use it.  I do seem to recall a nice write up about it on Lennart's blog though.  But it seems as though the intent of the systemd.unit.d (what they are calling "drop-in" modifications/replacements) is intended to replace the .include way.  Though I am basing that statement off of the general attitude toward each on the mailing list, and I have seen no official word on this.
    The nice thing about using .include is that you can use systemd-delta to see the changes made using that method.  And while the systemd.unit.d changes are noted in that output, it is nothing more than simply indicating that there has been modification.  The .include stuff actually has a full "diff -u" style output.

  • [SOLVED] systemd .service file for ruby rainbows server

    I am trying to create a systemd .service file for a ruby rainbows server.
    http://rainbows.rubyforge.org/
    does anybody have experience with a forking deamon under systemd?
    Mine immediatley terminates after starting.
    Last edited by wabi (2013-01-03 11:11:02)

    This is a .service file that will work:
    [Unit]
    Description=Redmine Rainbows Rails server
    [Service]
    Type=forking
    SyslogIdentifier=redmine
    User=http
    PIDFile=/var/www/redmine/tmp/pids/rainbows.pid
    WorkingDirectory=/var/www/redmine
    ExecStart=/usr/bin/bundle exec rainbows --host 127.0.0.1 --port 8001 --env production --daemonize --config-file /var/www/redmine/config/rainbows.rb
    ExecReload=/bin/kill -HUP $MAINPID
    ExecStop=/bin/kill -QUIT $MAINPID
    [Install]
    WantedBy=multi-user.target
    Last edited by wabi (2013-01-03 11:11:38)

  • [Solved] Suspend to Disk: systemd-hibernate.service Fails

    Howdy-ha, folks.  I know this looks pretty mundane, but for the life of me I can't get hibernation to work.  Each time I run systemctl hibernate the screen will go blank as though preparing to suspend, then come back on; journalctl shows the same error messages:
    PM: Cannot find swap device, try swapon -a.
    PM: Cannot get swap writer
    Failed to start Hibernate.
    Dependency failed for Hibernate.
    Service sleep.target is not needed anymore. Stopping.
    Unit systemd-hibernate.service entered failed state.
    This happens when swap is mounted, and "swapon" says as much.  I've been working on this for about four hours now, and none of what I've found seems to pertain to my situation (most of the "solutions" were "Increase partition size').
    What I've tried:
    - Three different kernels---linux-ck custom build and linux-ck-sandybridge from graysky's repo (both with BFQ and CFQ: see below), as well as the stock Arch kernel
    - A 2 Gb swap file at /swapfile on my SSD;
    - A 4 Gb swap partition on /dev/mmcblk0 (an SD card, and my preferred method/location, if possible);
    - An 8 Gb swap partition on HDD /dev/sdb2
    Reasons for wanting hibernate rather than suspend-to-RAM:
    - Maximize battery life.
    - There's some kind of issue with Linux-ck and suspending to RAM; it'll work once, then freeze in a kernel panic the second time, forcing a hard reset.  The stock kernel suspends to RAM, but still won't hibernate
    - I put a lot of time into building a custom Linux-ck kernel, and would rather not have to start the configuration over with the stock kernel if possible.
    I'm working with limited space on my boot drive and, as mentioned, increasing the amount of swap has no bearing on this.  The resulting phenomenon and error messages are the same, regardless of size and medium.  I've exhausted my ideas on where to look, and what to even look for.  Thanks a lot to everyone in advance (especially you,karol; don't think I don't see you lurking back there )
    Last edited by ANOKNUSA (2013-11-17 05:32:14)

    I rebooted, so trying to recreate the same situation:
    $ free -h
    total used free shared buffers cached
    Mem: 7.7G 7.2G 525M 0B 32M 2.3G
    -/+ buffers/cache: 4.8G 2.9G
    Swap: 3.7G 0B 3.7G
    top reports nearly the same thing:
    top - 20:00:13 up 22 min, 1 user, load average: 0.12, 0.22, 0.14
    Tasks: 155 total, 1 running, 154 sleeping, 0 stopped, 0 zombie
    %Cpu(s): 0.1 us, 0.3 sy, 0.1 ni, 99.5 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
    KiB Mem: 8061380 total, 7500096 used, 561284 free, 34432 buffers
    KiB Swap: 3872236 total, 0 used, 3872236 free, 2417172 cached
    htop, however, reports about 1.5 Gb more free RAM.  After reboot, swappiness is still set to 100 with the same results.
    EDIT:
    ANOKNUSA wrote: I'll test it again with the other locations mentioned in the OP, and get back to you.
    Even though I rebooted, I haven't done this yet, so ignore it for the moment.
    Last edited by ANOKNUSA (2013-08-28 01:06:10)

  • [solved] allow a systemd user service to shutdown the pc (mythtv)

    Hi,
    I have a problem with my mythtv htpc. What I want is to shutdown the PC if the PC idles.
    Mythtv (a pvr htpc software) recognizes if nobody is watching something and starts to shutdown the PC. This is not working ;(
    By default, mythtv is running als a system service with a "User=xxx" line in his .service file. I managed to configure mythtv to run as user service, so the user can start/stop it with "systemctl --user start/stop mythbackend" ... but this doesn't solve the problem.
    I installed polkit and now the user is able to shutdown the pc (systemctl poweroff) but this also doesn't help.
    I already asked in the german forum but nobody has a idea.
    Here is the german thread: https://bbs.archlinux.de/viewtopic.php?id=25290
    in the first post, you can see my journald output.
    can somebody help me? google can't
    I don't think this is a mythtv related problem, I think user services are just not allowed to shutdown the pc.
    thx for your help!
    Last edited by muh3 (2014-01-10 13:26:36)

    To handle power from XBMC polkit rule is needed. It is probably the same with mythtv.
    polkit.addRule(function(action, subject) {
    if (action.id.match("org.freedesktop.login1.") && subject.isInGroup("mythtv")) {
    return polkit.Result.YES;
    Save this as /etc/polkit-1/rules.d/10-mythtv.rules and add user to mythtv group.

  • [SOLVED] systemd adsl service does not start

    After the today's upgrade of my system I get lines like this in my journal, as the adsl service does not want to start.
    # router systemd[522]: Failed at step EXEC spawning /usr/sbin/pppoe-start: No such file or directory
    The problem is, that pppoe-start is in /usr/bin/ and not in /usr/sbin. According to pacman (pacman-Ql rp-pppoe) /usr/bin/ is the correct location.
    I really don't know, why systemd is trying to launch it, because even the service file (/usr/lib/systemd/system/adsl.service) points to the correct location.
    [Unit]
    Description=ADSL Deamon
    [Service]
    Type=forking
    ExecStart=/usr/bin/pppoe-start
    ExecStop=/usr/bin/pppoe-stop
    [Install]
    WantedBy=multi-user.target
    The service is launching and stopping with pppoe-start and pppoe-stop.
    When launched, it also shuts down fine when stopping it by
    systemctl stop adsl
    Why the hell is it trying to launch from /usr/sbin/?
    Last edited by scar (2013-06-04 13:07:23)

    It goes definitely against any logic.
    The service file looks good, but I've copied it to /usr/lib/systemd/system/bdsl.service. Same contents - and the new one launches succesfully.
    I've deleted the original ...adsl.service file, verified that it disappeared, copied it back from the new bdsl.service file, and it still does not launch.
    [EDIT]
    I've erased the drive, restored the system from a 1 week old backup, started it - everything worked. Then I'v updated the whole system, including the rp-pppoe package, and the adsl service is failing again.
    Downgrading solves the problem. Should I file a bug report?
    Last edited by scar (2013-06-01 10:14:41)

  • [SOLVED]Create .service file to load powertop settings at startup.

    Hi I installed powertop and ran it
    sudo powertop -html
    and the recommendations I got, i pasted them in a file, and saved it as startup.sh, and made it executable.
    Now with init, i could write it in /etc/rc.local so that it would be called automatically at startup, but with systemd,
    I think one would need to create a systemd service file which could be enabled for startup,and would call the startup.sh file.
    Can anyone help with creating the .service file, or alternatively, suggest a simpler method for loading powertop's reccomendations at startup? Thanks!
    Last edited by aaditya (2013-09-04 18:29:53)

    Really, this should be done with the tools that are inherently in the system.  So it should be achieved with module options, udev rules, sysctl.d/sysctl.conf, and in some cases, tmpfiles.d.
    See this wiki page to get an idea of how to get this stuff going.
    You can use some kind of rc.local service if you want.  But it is probably moer appropriate to have these things load only if necessary.  For example, if there is a power saving option for my ethernet card, but I choose to only load the module when I need it (therefore blacklist it) in order to really save power, it would be silly to have a script that tries to write values to a directory in /sys/class/net that doesn't exist.
    Alternatively, you could use something like laptop-mode-tools, which allows one to have these settings turned on or off depending on the A/C state of the machine. But I really think that with machines these days, there is really not much of a difference whether these power saving functions are on or off, in terms of an average users computing experience.

Maybe you are looking for

  • How to transport SPROXY's on  SR3 , SP14

    Dear All, I developed the ABAP server proxyu2019s in SR2 , SP12 version and QA environment we were installed SR3 , SP14 version. And in SR3 version SPROXY transaction code pointing to SE80 T.code , as of this blog I came to know that ABAP proxies has

  • Java Mapping. Pls help

    Hi, Question: 1. What is java mapping. 2. How I use java mapping/UDF in message mapping     for my below scenario In my Request XML there are 2 fields. In my Response XML there are 2 fields. Field 1 of Request XML needs to be mapped directly to Field

  • Itunes 6.0.2

    I just reloaded OS 10.4.7 on my iMac 17" (Intel Core Duo 1.83 Ghz).  I ran all software updates, and iTunes is set at 6.0.2 (23). It is not permitting me to access the iTunes Store.  My internet connection is working fine. What to do? sue

  • One service order and multiple services  ??????????

    Hello All I am working on CRM 5.0 service module Can I create a service order with more than one service I mean one document but contains multiple services and assign each service to a person responsible? And how? Thanks in advance Regards Jacopo Fra

  • VIP in Intermediate state after relocate

    11.2.0.2.0 windows 2008 2 node RAC Rolling patch. Brought down and relocated all services to node 2. All services start ok except for node 1 VIP which goes to intermediate and FAILED OVER state. C:\Windows\system32>crsctl status resource -t ora.rac01