[SOLVED]Correct way to restart a systemd service on resume from susp?

I have offlineimap setup to run as a daemon. It doesn't correctly resume operations after a resume from suspend to RAM without being restarted. The 'Conflicts=' line in the service file makes sure it is stopped when the machine suspends, but I can't figure out how to get it restarted again. Here is the service file:
[Unit]
Description=Start offlineimap as a daemon
Requires=network.target
Conflicts=suspend.target
After=network.target
[Service]
User=%i
EnvironmentFile=/home/%i/.gnupg/gpg-agent-info
ExecStart=/usr/bin/offlineimap
KillSignal=SIGUSR2
Restart=always
RestartSec=15
[Install]
WantedBy=multi-user.target
I found an email thread here that seemed to imply that I could add sleep.target to 'WantedBy=' and sleep.target to 'After=' to get service to startup again after resume, but that didn't seem to work.
Any ideas? Thanks!
Scott
Last edited by firecat53 (2014-07-01 16:40:20)

tomk wrote:
firecat53 wrote:It doesn't correctly resume operations after a resume from suspend to RAM without being restarted.
Is this just something you have observed on your own system, or is it a known bug?
Something I noticed and figured it was just due to frequently switching networks with VPN on/off again. After a quick search, I discovered the 'socktimeout' option, which I'm testing now to see if that solves the problem. It appears (although I _just_  found this, that it is a known bug. Some have had luck with setting socktimeout, others haven't. I'll post back if I see a difference or not.
Thanks for the nudge
Scott

Similar Messages

  • Restarting a systemd.service with a dependency job failed.

    Hello.
    Let's say I have foo.service containing that:
    [Unit]
    Description=Is executed only if bar.service success
    Requires=bar.service
    After=bar.service
    [Service]
    Type=simple
    TimeoutSec=6
    Restart=on-failure
    ExecStart=/usr/bin/touch /tmp/test
    And i have bar.service containing that:
    [Unit]
    Description=Test in foo.tld is reachable
    [Service]
    Type=oneshot
    ExecStart=/usr/bin/ping -c1 foo.tld
    [Install]
    WantedBy=multi-user.target
    If the ping fails in bar.service, then I'll get that when I try to start foo.service: « A dependency job for foo.service failed. See 'journalctl -xn' for details. »
    How can I make foo.service check every n seconds if its dependency jobs are fullfilled/successfull instead of just failing and stopping like it currently does ?
    I'm searching for a "Restart" option that would apply if the dependency check fails. I'm not sure if this is possible.
    Thank you in advance for your answers.

    Maybe you're looking for RequiresOverrideable? From the man page of systemd.unit
    RequiresOverridable=
    Similar to Requires=. Dependencies listed in RequiresOverridable= which cannot be fulfilled or fail to start are ignored if the startup was explicitly requested by the user. If the start-up was
    pulled in indirectly by some dependency or automatic start-up of units that is not requested by the user, this dependency must be fulfilled and otherwise the transaction fails. Hence, this option
    may be used to configure dependencies that are normally honored unless the user explicitly starts up the unit, in which case whether they failed or not is irrelevant.

  • What is the correct way to get a machine serviced?

    Initially, my machine had an issue with the backlight, and the local dealer replaced the logic board which did nothing, so I took it back and they replaced the screen, but after replaceing the screen, the "closed lid" sensor no longer works and the machine will only sleep from software, not when the lid is closed. They won't return my calls, and they seem pretty inept anyhow.
    (http://www.corporatecomputers.ca/)
    I took the machine to the other dealer here in town to see if they would fix it, and after holding on to it for 3 days, they said it wasn't a hardware problem--I should reinstall the operating system. I did that for ***** and giggles knowing full well it wouldn't actually do anything, and sure enough it didn't.
    (http://www.mymacdealer.com/)
    There is a third dealer here in town, but of the 5 other apple owners I know with computers that needed servicing in Edmonton, all 5 of them insist they are in fact, worse than the other two, and after some of the stories, I believe them. (http://www.westworld.com/)
    Now, knowing full well I payed half a thousand dollars for comprehensive support from Apple and all technicians here in town are stupid (for lack of a better word), how the **** am I supposed to fix this P.O.S?
    Powerbook 17"   Mac OS X (10.4.6)   its a P.O.S.

    why not mail it in to apple directly?
    Not a terrible idea, especially given how much time has been wasted on this already. I'm not a big fan of the idea of not having a computer for however long it takes 2 cross-country shippings and a repair, but it seems whether I get it don't locally or not, that's the only option left.

  • Apple TV needs Restart for Airplay especially after resuming from Sleep Mode

    1. I always have to restart my Apple TV for Airplay when I resume it from Sleep Mode. Neither my MAC not my PC nor my iPhone/iPad can connect to Airplay if it's not retsarted. I did a complete Factory Reset of Apple TV thinking it would be the best way of troubleshooting but in vein. Any help/suggestion/tips from anybody please?
    2. Also - Does Apple TV needs internet always for Airplay? I guess that should work on the LAN even if there is no internet connectivity, Correct?
    Regards,

    Hey loftysub,
    I'd check out the following article, it should be able to help you out:
    Troubleshooting AirPlay and AirPlay Mirroring
    http://support.apple.com/kb/TS4215
    Cheers,
    David

  • [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.

  • I would like to read a text file in which the decimal numbers are using dots instead of commas. Is there a way of converting this in labVIEW, or how can I get the program to enterpret the figures in the correct way?

    The program doest enterpret my figures from the text file in the correct way since the numbers contain dots instead of commas. Is there a way to fix this in labVIEW, or do I have to change the files before reading them in the program? Thanks beforehend!

    You must go in the labview option menu, you can select 'use the local
    separator' in the front side submenu (LV6i).
    If you use the "From Exponential/Fract/Eng" vi, you are able to select this
    opton (with a boolean) without changing the labview parameters.
    (sorry for my english)
    Lange Jerome
    FRANCE
    "Nina" a ecrit dans le message news:
    [email protected]..
    > I would like to read a text file in which the decimal numbers are
    > using dots instead of commas. Is there a way of converting this in
    > labVIEW, or how can I get the program to enterpret the figures in the
    > correct way?
    >
    > The program doest enterpret my figures from the text file in the
    > correct way since the numbers contain dots instea
    d of commas. Is there
    > a way to fix this in labVIEW, or do I have to change the files before
    > reading them in the program? Thanks beforehend!

  • [SOLVED] Can not shutdown/restart from KDE with systemd

    Hello,
      Recently, following I switched to a pure systemd setup.  The process was simple and most things worked "right out of the bpx".  However, I can not shutdown or restart from KDE!
    Let's say that I do the 3 finger salute (ALT-CTRL-DEL) and select "Turn off computer" what I get is KDE shutting down, but then I will only get a console (TTY) login prompt.  Pressing ALT-CTRL-DEL then will trigger a reboot.  I can also login and use "systemctl poweroff".  However, I don't understand why it doesn't work straight from KDE.
    Are there some packages I must install?  Are there some systemd services that I must enable?  What other relevant info should I include in this post?
    Active units :
    UNIT LOAD ACTIVE SUB JOB DESCRIPTION
    proc-sys...misc.automount loaded active waiting Arbitrary Executable File Formats File System Automount Point
    sys-devi...d-card0.device loaded active plugged MCP79 High Definition Audio
    sys-devi...da-sda1.device loaded active plugged ST9500420ASG
    sys-devi...da-sda2.device loaded active plugged ST9500420ASG
    sys-devi...da-sda3.device loaded active plugged ST9500420ASG
    sys-devi...da-sda4.device loaded active plugged ST9500420ASG
    sys-devi...da-sda5.device loaded active plugged ST9500420ASG
    sys-devi...da-sda6.device loaded active plugged ST9500420ASG
    sys-devi...ock-sda.device loaded active plugged ST9500420ASG
    sys-devi...et-eth0.device loaded active plugged RTL8111/8168B PCI Express Gigabit Ethernet controller
    sys-devi...t-wlan0.device loaded active plugged AR928X Wireless Network Adapter (PCI-Express)
    sys-devi...y-ttyS0.device loaded active plugged /sys/devices/platform/serial8250/tty/ttyS0
    sys-devi...y-ttyS1.device loaded active plugged /sys/devices/platform/serial8250/tty/ttyS1
    sys-devi...y-ttyS2.device loaded active plugged /sys/devices/platform/serial8250/tty/ttyS2
    sys-devi...y-ttyS3.device loaded active plugged /sys/devices/platform/serial8250/tty/ttyS3
    sys-module-fuse.device loaded active plugged /sys/module/fuse
    -.mount loaded active mounted /
    dev-hugepages.mount loaded active mounted Huge Pages File System
    dev-mqueue.mount loaded active mounted POSIX Message Queue File System
    home.mount loaded active mounted /home
    run-user-1000-gvfs.mount loaded active mounted /run/user/1000/gvfs
    sys-fs-f...nections.mount loaded active mounted FUSE Control File System
    sys-kernel-debug.mount loaded active mounted Debug File System
    tmp.mount loaded active mounted /tmp
    cups.path loaded active waiting CUPS Printer Service Spool
    systemd-...d-console.path loaded active waiting Dispatch Password Requests to Console Directory Watch
    systemd-...word-wall.path loaded active waiting Forward Password Requests to Wall Directory Watch
    bluetooth.service loaded active running Bluetooth service
    colord-sane.service loaded active running Daemon for monitoring attached scanners and registering them with colord
    colord.service loaded active running Manage, Install and Generate Color Profiles
    console-...daemon.service loaded active running Console Manager
    console-...-start.service loaded active exited Console System Startup Logging
    cups.service loaded active running CUPS Printing Service
    dbus.service loaded active running D-Bus System Message Bus
    [email protected] loaded active running Getty on tty1
    kdm.service loaded active running K Display Manager
    NetworkManager.service loaded active running Network Manager
    sshd.service loaded active running OpenSSH Daemon
    systemd-journald.service loaded active running Journal Service
    systemd-logind.service loaded active running Login Service
    systemd-...s-load.service loaded active exited Load Kernel Modules
    systemd-...unt-fs.service loaded active exited Remount Root and Kernel File Systems
    systemd-sysctl.service loaded active exited Apply Kernel Variables
    systemd-...-setup.service loaded active exited Recreate Volatile Files and Directories
    systemd-...rigger.service loaded active exited udev Coldplug all Devices
    systemd-udevd.service loaded active running udev Kernel Device Manager
    systemd-...ssions.service loaded active exited Permit User Sessions
    systemd-...-setup.service loaded active exited Setup Virtual Console
    udisks2.service loaded active running Storage Daemon
    upower.service loaded active running Daemon for power management
    wpa_supplicant.service loaded active running WPA supplicant
    cups.socket loaded active running CUPS Printing Service Sockets
    dbus.socket loaded active running D-Bus System Message Bus Socket
    systemd-initctl.socket loaded active listening /dev/initctl Compatibility Named Pipe
    systemd-journald.socket loaded active running Journal Socket
    systemd-shutdownd.socket loaded active listening Delayed Shutdown Socket
    systemd-...control.socket loaded active listening udev Control Socket
    systemd-...-kernel.socket loaded active running udev Kernel Socket
    basic.target loaded active active Basic System
    cryptsetup.target loaded active active Encrypted Volumes
    getty.target loaded active active Login Prompts
    graphical.target loaded active active Graphical Interface
    local-fs-pre.target loaded active active Local File Systems (Pre)
    local-fs.target loaded active active Local File Systems
    multi-user.target loaded active active Multi-User
    network.target loaded active active Network
    remote-fs.target loaded active active Remote File Systems
    sockets.target loaded active active Sockets
    sound.target loaded active active Sound Card
    swap.target loaded active active Swap
    sysinit.target loaded active active System Initialization
    systemd-...es-clean.timer loaded active waiting Daily Cleanup of Temporary Directories
    LOAD = Reflects whether the unit definition was properly loaded.
    ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
    SUB = The low-level unit activation state, values depend on unit type.
    JOB = Pending job for the unit.
    72 units listed. Pass --all to see inactive units, too.
    Last edited by Prozzaks (2012-08-20 17:35:48)

    Demon wrote:For me the system only halts, it does not poweroff. How I can solve this?
    As bgc1954 said, there is also a symlink "/sbin/poweroff". Just edit the file "/usr/share/config/kdm/kdmrc", go to [shutdown] an replace the line "HaltCmd=/sbin/halt" with "HaltCmd=/sbin/poweroff".

  • Restart Systemd service after laptop resume

    Hi!
    After resume my laptop (from suspend, I've no tried hibernation) I need to restart NetworkManager service. How can I do this automaticaly?, I've searched in google and Systemd documentation but I have not a clear idea about how to do it.
    thanks

    Gazpacho wrote:
    lucke wrote:As boast said, you can make pm-utils run "systemctl restart networkmanager.service" after resume for you. https://wiki.archlinux.org/index.php/Pm … _own_hooks
    Sorry (to boast too), you are right. I've read the wiki and created a hook, now NM restarts after resume. Thanks!
    And now I've discovered that my computer only suspends the first time. Second time nothing happens when I close the tap, execute pm-suspend or the KDE menu option suspend to ram
    If you have any idea it is welcome. If not I will mark the thread as solved in a couple of days and search in forums and wiki.
    this usually happens when your hook doesn't exit. pm-suspend never finishes because it's waiting for the hook to exit and the second pm-suspend will block until the other pm-suspend is finished. Please post your hook.

  • [SOLVED] A custom systemd service doesn't execute a specific command

    I have made a custom service which should set screen brightness.
    file: /etc/systemd/system/backlight100.service
    [Unit]
    Description=Set screen brightness
    [Service]
    Type=oneshot
    ExecStart=/bin/echo 100 > /sys/class/backlight/intel_backlight/brightness
    ExecStart=/usr/bin/beep
    [Install]
    WantedBy=multi-user.target
    (beep is there so I can know for sure that the script runs)
    The problem is, when I run "# systemctl start backlight100.service" I can hear the beep but it doesn't change the brightness. When I run "/bin/echo 100 > /sys/class/backlight/intel_backlight/brightness" in terminal it does change the brightness... but not when I start or restart the service.
    Here's the output of systemctl status backlight100.service after starting it
    backlight100.service - Set screen brightness
    Loaded: loaded (/etc/systemd/system/backlight100.service; enabled)
    Active: inactive (dead) since Fri 2013-04-05 20:17:32 AMT; 3min 19s ago
    Process: 27698 ExecStart=/usr/bin/beep (code=exited, status=0/SUCCESS)
    Process: 27696 ExecStart=/bin/echo 100 > /sys/class/backlight/intel_backlight/brightness (code=exited, status=0/SUCCESS)
    Apr 05 20:17:32 work systemd[1]: Starting Set screen brightness...
    Apr 05 20:17:32 work echo[27696]: 100 > /sys/class/backlight/intel_back...ss
    Apr 05 20:17:32 work systemd[1]: Started Set screen brightness.
    What am I doing wrong here? Any help appreciated.
    Last edited by axper (2013-04-05 18:35:24)

    msthev wrote:$ man systemd.service
    ExecStart=
    Note that this setting does not directly support shell command
    lines. If shell command lines are to be used they need to be passed
    explicitly to a shell implementation of some kind. Example:
    ExecStart=/bin/sh -c 'dmesg | tac'
    Thanks, changing ExecStart line to
    ExecStart=/bin/bash -c '/bin/echo 100 > /sys/class/backlight/intel_backlight/brightness'
    solved the issue. Though I can recall seeing ExecStart lines with direct shell commands.
    Raynman wrote:
    You should look at tmpfiles.d.
    https://wiki.archlinux.org/index.php/Sy … rary_files
    I'll do that, thanks!

  • [SOLVED] Run kded as a separate (systemd?) service

    Hi.
    I'm currently trying to enrich wmii session with some kde features.
    For example to allow kde to manage my keyboard I can do
    $ kded4
    $ qdbus org.kde.kded /kded loadModule keyboard
    The issue is that I can't start kded on login. I've tried both .xinitrc and systemd way. The outcome is always the same: kded4 won't work for the first time. There are 4 processes of kded4 and none of them responds to dbus calls. However, killing out all of its processes and starting again results in kded4 behaving correctly.
    So, here what I have currently
    systemd service
    [Unit]
    Description=KDE daemon
    [Service]
    ExecStart=/usr/bin/kded4
    [Install]
    WantedBy=workspace.target
    After an attempt to start
    $ systemctl --user status kded
    kded.service - KDE daemon
    Loaded: loaded (/home/edio/.config/systemd/user/kded.service; disabled)
    Active: active (running) since Sat 2013-03-09 19:39:40 EET; 1s ago
    Main PID: 25887 (kded4)
    CGroup: name=systemd:/user/edio/4/systemd-25706/kded.service
    ├─25887 /usr/bin/kded4
    ├─25895 /usr/bin/kded4
    ├─25900 /usr/bin/kdeinit4 --suicide
    ├─25901 /usr/bin/kdeinit4 --suicide
    ├─25902 kdeinit4: klauncher [kdeinit] --fd=8
    └─25904 kdeinit4: kded4 [kdeinit]
    Mar 09 19:39:40 xi systemd[25706]: Starting KDE daemon...
    Mar 09 19:39:40 xi systemd[25706]: Started KDE daemon.
    Mar 09 19:39:40 xi kded4[25887]: QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
    Mar 09 19:39:40 xi kded4[25887]: QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
    Mar 09 19:39:40 xi kded4[25887]: QGtkStyle was unable to detect the current GTK+ theme.
    Mar 09 19:39:40 xi kded4[25887]: Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
    Mar 09 19:39:40 xi kded4[25887]: QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
    Mar 09 19:39:40 xi kded4[25887]: KDE Daemon (kded) already running.
    Mar 09 19:39:40 xi kded4[25887]: QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
    Has anyone tried that already? Any ideas, how to start kded4?
    Thanks in advance.
    Last edited by eDio (2013-03-10 21:11:00)

    I finally managed this to work.
    Results of this are available on github.
    Let me know please, if you think this info is worth a wiki page or a dedicated topic.
    https://github.com/edio/systemd-kdemodules

  • [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] Help with systemd .service script

    Hello,
    I have been using ArchLinux (ARM version) on some “plug computers” for over a year and love it.  Recently I forced myself to move to systemd by upgrading all my computers from scratch.  I migrated all my applications and learned new ways of doing things but am having trouble with one last migration.  I run a c++ communication program that monitors a TCP port for traffic.  In the past I started this program (daemon) from an entry in rc.conf.  I have read all I can about systemd’s new approach to starting daemons (https://wiki.archlinux.org/index.php/Systemd and https://wiki.archlinux.org/index.php/Systemd/Services)
    So far I created what I thought is the correct systemd .service file listed below.
    [Unit]
    Description=EQBCS
    After=network.target
    [Service]
    Type=simple
    ExecStart=/home/public/EQBCS/eqbcs -p 12947 -d &> /dev/null
    [Install]
    WantedBy=multi-user.target
    I put this file in /usr/lib/systemd/system/eqbcs.service.  I then ran the following commands in the following order:
    systemctl daemon-reload
    systemctl enable eqbcs.service (created a link in /etc/systemd/system/multi-user.target.wants)
    systemctl start eqbcs.service
    Here is output from systemctl (status)
    eqbcs.service                                 loaded failed failed    EQBCS
    I thought this would start the service but no luck.  I also thought maybe a reboot would work but no luck.  I verified I can start the daemon manually if I run /home/public/EQBCS/eqbcs -p 12947 -d &> /dev/null from the command line.
    I think I am close, but after several hours of looking at examples of .service files and other posts, I am at a loss.  I am not one of those types who posts a question without taking the time to read the wealth of information on these boards, but I am truly out of ideas and can’t figure out what to do next.  I sincerely could use some help/advice.
    Last edited by calzon65 (2013-06-01 21:18:20)

    Thank you for the suggestions, I believe I am getting closer to success. When I run systemctl start eqbcs.servcie it starts the service but the only way I can get out of systemctl is to ^c out.
    Here is my current .service file:
    [Unit]
    Description=EQBCS
    After=network.target
    [Service]
    ExecStart=/home/public/EQBCS/eqbcs -p 12947
    Type=forking
    [Install]
    WantedBy=multi-user.target
    Output from systemctl status eqbcs:
    eqbcs.service - EQBCS
       Loaded: loaded (/etc/systemd/system/eqbcs.service; enabled)
       Active: failed (Result: timeout) since Sat 2013-06-01 12:48:43 PDT; 2min 11s ago
      Process: 427 ExecStart=/home/public/EQBCS/eqbcs -p 12947 (code=killed, signal=TERM)
    Main PID: 396 (code=killed, signal=KILL)
       CGroup: name=systemd:/system/eqbcs.service
    Jun 01 12:47:13 alarm systemd[1]: Starting EQBCS...
    Jun 01 12:47:13 alarm eqbcs[427]: WARNING: Running as root NOT recommended.
    Jun 01 12:47:13 alarm eqbcs[427]: EQ Box Chat Server 10.12.18
    Jun 01 12:47:13 alarm eqbcs[427]: Waiting for connections on port: 12947...
    Jun 01 12:48:43 alarm systemd[1]: eqbcs.service operation timed out. Terminating.
    Jun 01 12:48:43 alarm systemd[1]: Failed to start EQBCS.
    Jun 01 12:48:43 alarm systemd[1]: Unit eqbcs.service entered failed state.
    Are there any other suggestions for settings in my .service file?

  • [SOLVED] systemd service dependencies

    Hi,
    I've just setup a new arch install, using a pure systemd setup.
    I have two services, tinc and tinyproxy. In my case tinyproxy will only bind to an interface that tinc sets ups. So I have to make sure that tinyproxy startup depends on tinc. Now, I could edit the service file installed by the tinyproxy package, but I'd like to know if there is a better way to do that. With the old rc.conf sysinit I simply made sure to have the demons in the correct order and everything worked
    So, is there a better way to add custom dependencies between systemd services besides manually editing the service files?
    kind regards
    Last edited by nomenquis (2012-09-27 08:00:56)

    WorMzy wrote:Don't edit the package-provided .service file, it'll be overwritten when the package gets updated.
    Yea, that's why I was afraid / didn't want to edit them :)
    WorMzy wrote:Instead, copy it to /etc/systemd/system, and edit it there.
    There's no other dependency mechanism as far as I know.
    Ahh, didn't know that /etc/ files would override the ones provided in /usr/lib/...
    I suspected there was some simple mechanism but seem to have missed that one.
    Thanks a lot!
    kind regards

  • [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).

  • Doh! How do I make a simple systemd service...? [SOLVED]

    I've procrastinated long enough.
    I have a few symbolic links from various locations that all lead to directories in /tmp or /dev/shm.  These directories were simply created by mkdir in rc.local, and I've forgotten about it sometime ago.
    I want systemd to do something like:
    mkdir -p /tmp/foo/bar
    chmod -R o+rw /tmp/foo/bar
    everytime I start up my computer.   I used to have it all in rc.local and it's far simpler than what most people's startup scripts look like.
    I tried making this service file, but I'm doing something wrong (due to my lack of understanding, please forgive me).  It shows up as a static service.
    [Unit]
    Description=rc.local ported to systemd
    [Service]
    Type=oneshot
    ExecStart=/usr/local/bin/rc.local
    The rc.local file referenced was simply copied before initscripts were removed.  It contains the series of mkdir and chmod commands (and nothing more).
    -ak
    Last edited by akspecs (2013-02-18 03:27:43)

    cfr wrote:I *think* the way to do this is with temp files but I've never actually had to use these myself. Bound to be in the wiki, though.
    the manpage for this is tmpfiles.d (5).

Maybe you are looking for

  • How to Suppress the POP UP window for Print out Device

    Hi All, I have One ALV Grid report and in this report I want to SUBMIT another report which, when executes gives the POP UP window for Printer Device and sends the output to that device. if we give LOCL, sends output to Spool. So I want to Suppress t

  • Itunes has stopped working when turning on genius for windows 7

    Has anyone had itunes has stopped working while trying to turn on genuis for windows 7.  Also i have a new toshiba satellite c655d-s5200 laptop. Thanks

  • VL10a - Dialog vs. Background

    Hi All, I need input regarding this scenario with tcode VL10a. I have a Sales Order and I create delivery for it through VL10a. My SO has 3 line items. When I process the SO in Dialog mode, a delivery is created for all three line items. When I use t

  • Adobe CS4 Web Premium - Adobe updater "there are no updates available at this time"

    I have done a clean install of Adobe CS4 Web Premium via the orginal DVD media. Straight after I go to adobe updater to update the products, but it just says "there are no updates available at this time." at First I thought this might be mcafee hips

  • TNS-12537

    Hi, I am working in oracle 10g on windows server.... I want to connect to the oracle 10g Database which is on HP_UX.... I made the entry in TNSNAMES.ORA file and the i try to use tnsping peers i am getting the error as TNS-12537 connection closed...