Systemd service starts command twice

Hello,
i have a problem with systemd service for inotifywait check my mails.
service:
[Unit]
Description=Start mailnotify as a daemon
Requires=offlineimap.service
After=offlineimap.service
[Service]
User=matija
ExecStart=/home/matija/bin/mailnotify.sh
[Install]
WantedBy=multi-user.target
and when i start it:
sudo systemctl status mailnotify.service
mailnotify.service - Start mailnotify as a daemon
Loaded: loaded (/usr/lib/systemd/system/mailnotify.service; disabled)
Active: active (running) since Wed, 2012-12-12 15:46:00 CET; 6s ago
Main PID: 13650 (mailnotify.sh)
CGroup: name=systemd:/system/mailnotify.service
├─13650 /bin/bash /home/matija/bin/mailnotify.sh
├─13652 /bin/bash /home/matija/bin/mailnotify.sh
└─13653 inotifywait -e create -e moved_to /home/matija/Maildir/Archives.2012/new /home/matija/Maildir/Archives/new /hom...
Dec 12 15:46:00 workarch systemd[1]: Starting Start mailnotify as a daemon...
Dec 12 15:46:00 workarch systemd[1]: Started Start mailnotify as a daemon.
but it doesn't work.
when i start /home/matija/bin/mailnotify.sh it works as expected.
Could you please help me with that?
Thanks

You'll have to run journalctl as root. It should be logged as UNIT=bar.service, SYSLOG_IDENTIFIER=systemd, one example from me:
sudo systemctl start chrony.service
sudo systemctl stop chrony.service
sudo journalctl -o verbose --since today UNIT=chrony.service SYSLOG_IDENTIFIER=systemd
Sa 2014-09-06 01:19:32.432387 CEST [s=###########################;i=#####;b=###########################;m=#######;t=##########;x=#############]
PRIORITY=6
_UID=0
_GID=0
_MACHINE_ID=###########################
_HOSTNAME=pamobile
SYSLOG_FACILITY=3
SYSLOG_IDENTIFIER=systemd
_TRANSPORT=journal
_PID=1
_COMM=systemd
_EXE=/usr/lib/systemd/systemd
_CMDLINE=/sbin/init
_CAP_EFFECTIVE=3fffffffff
_SYSTEMD_CGROUP=/
CODE_FILE=src/core/job.c
CODE_LINE=721
CODE_FUNCTION=job_log_status_message
MESSAGE_ID=#######################
RESULT=done
UNIT=chrony.service
MESSAGE=Started Chrony Network Time Daemon.
_BOOT_ID=############################
_SOURCE_REALTIME_TIMESTAMP=###########
Sa 2014-09-06 01:19:40.538847 CEST [s=###############################;i=#####;b=###############################;m=########;t=############;x=#########################]
PRIORITY=6
_UID=0
_GID=0
_MACHINE_ID=###############################
_HOSTNAME=pamobile
SYSLOG_FACILITY=3
SYSLOG_IDENTIFIER=systemd
_TRANSPORT=journal
_PID=1
_COMM=systemd
_EXE=/usr/lib/systemd/systemd
_CMDLINE=/sbin/init
_CAP_EFFECTIVE=3fffffffff
_SYSTEMD_CGROUP=/
CODE_FILE=src/core/job.c
CODE_FUNCTION=job_log_status_message
RESULT=done
UNIT=chrony.service
CODE_LINE=729
MESSAGE_ID=###############################
MESSAGE=Stopped Chrony Network Time Daemon.
_BOOT_ID=###############################
_SOURCE_REALTIME_TIMESTAMP=###################

Similar Messages

  • Systemd services starting before network is up

    I have a couple services that need the network to be up before they start. I have After=network.target in my .service unit. I have also tried After=netctl@ovh_net_eth0.service both did not work. Services error because no network when they are started. I have tried Google and searching the forums here and I am stumped.
    Services
    systemctl --type=service
    UNIT LOAD ACTIVE SUB DESCRIPTION
    cronie.service loaded active running Periodic Command Scheduler
    dbus.service loaded active running D-Bus System Message Bus
    [email protected] loaded active running Getty on tty1
    kmod-static-nodes.service loaded active exited Create list of required static device nodes for the current kernel
    netctl@ovh_net_eth0.service loaded active exited A basic static ethernet connection
    sshd.service loaded active running OpenSSH Daemon
    systemd-backlight@backlight:acpi_video0.service loaded active exited Load/Save Screen Backlight Brightness of backlight:acpi_video0
    systemd-journal-flush.service loaded active exited Flush Journal to Persistent Storage
    systemd-journald.service loaded active running Journal Service
    systemd-logind.service loaded active running Login Service
    systemd-modules-load.service loaded active exited Load Kernel Modules
    systemd-random-seed.service loaded active exited Load/Save Random Seed
    systemd-remount-fs.service loaded active exited Remount Root and Kernel File Systems
    systemd-sysctl.service loaded active exited Apply Kernel Variables
    systemd-timesyncd.service loaded active running Network Time Synchronization
    systemd-tmpfiles-setup-dev.service loaded active exited Create Static Device Nodes in /dev
    systemd-tmpfiles-setup.service loaded active exited Create Volatile Files and Directories
    systemd-udev-trigger.service loaded active exited udev Coldplug all Devices
    systemd-udevd.service loaded active running udev Kernel Device Manager
    systemd-update-utmp.service loaded active exited Update UTMP about System Boot/Shutdown
    systemd-user-sessions.service loaded active exited Permit User Sessions
    systemd-vconsole-setup.service loaded active exited Setup Virtual Console
    [email protected] loaded active running User Manager for UID 1000
    UNIT LOAD ACTIVE SUB DESCRIPTION
    proc-sys-fs-binfmt_misc.automount loaded active waiting Arbitrary Executable File Formats File System Automount Point
    sys-devices-pci0000:00-0000:00:02.0-backlight-acpi_video0.device loaded active plugged /sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0
    sys-devices-pci0000:00-0000:00:1c.0-0000:01:00.0-net-eth0.device loaded active plugged 82574L Gigabit Network Connection
    sys-devices-pci0000:00-0000:00:1f.2-ata1-host0-target0:0:0-0:0:0:0-block-sda-sda1.device loaded active plugged INTEL_SSDSA2CT040G3 1
    sys-devices-pci0000:00-0000:00:1f.2-ata1-host0-target0:0:0-0:0:0:0-block-sda-sda2.device loaded active plugged INTEL_SSDSA2CT040G3 swap-sda2
    sys-devices-pci0000:00-0000:00:1f.2-ata1-host0-target0:0:0-0:0:0:0-block-sda.device loaded active plugged INTEL_SSDSA2CT040G3
    sys-devices-platform-serial8250-tty-ttyS2.device loaded active plugged /sys/devices/platform/serial8250/tty/ttyS2
    sys-devices-platform-serial8250-tty-ttyS3.device loaded active plugged /sys/devices/platform/serial8250/tty/ttyS3
    sys-devices-pnp0-00:08-tty-ttyS1.device loaded active plugged /sys/devices/pnp0/00:08/tty/ttyS1
    sys-devices-pnp0-00:09-tty-ttyS0.device loaded active plugged /sys/devices/pnp0/00:09/tty/ttyS0
    sys-module-configfs.device loaded active plugged /sys/module/configfs
    sys-subsystem-net-devices-eth0.device loaded active plugged 82574L Gigabit Network Connection
    -.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
    run-user-1000.mount loaded active mounted /run/user/1000
    sys-kernel-config.mount loaded active mounted Configuration File System
    sys-kernel-debug.mount loaded active mounted Debug File System
    tmp.mount loaded active mounted Temporary Directory
    systemd-ask-password-console.path loaded active waiting Dispatch Password Requests to Console Directory Watch
    systemd-ask-password-wall.path loaded active waiting Forward Password Requests to Wall Directory Watch
    session-c2.scope loaded active running Session c2 of user concopa
    cronie.service loaded active running Periodic Command Scheduler
    dbus.service loaded active running D-Bus System Message Bus
    [email protected] loaded active running Getty on tty1
    kmod-static-nodes.service loaded active exited Create list of required static device nodes for the current kern
    netctl@ovh_net_eth0.service loaded active exited A basic static ethernet connection
    sshd.service loaded active running OpenSSH Daemon
    systemd-backlight@backlight:acpi_video0.service loaded active exited Load/Save Screen Backlight Brightness of backlight:acpi_video0
    systemd-journal-flush.service loaded active exited Flush Journal to Persistent Storage
    systemd-journald.service loaded active running Journal Service
    systemd-logind.service loaded active running Login Service
    systemd-modules-load.service loaded active exited Load Kernel Modules
    systemd-random-seed.service loaded active exited Load/Save Random Seed
    systemd-remount-fs.service loaded active exited Remount Root and Kernel File Systems
    systemd-sysctl.service loaded active exited Apply Kernel Variables
    systemd-timesyncd.service loaded active running Network Time Synchronization
    systemd-tmpfiles-setup-dev.service loaded active exited Create Static Device Nodes in /dev
    systemd-tmpfiles-setup.service loaded active exited Create Volatile Files and Directories
    systemd-udev-trigger.service loaded active exited udev Coldplug all Devices
    systemd-udevd.service loaded active running udev Kernel Device Manager
    systemd-update-utmp.service loaded active exited Update UTMP about System Boot/Shutdown
    systemd-user-sessions.service loaded active exited Permit User Sessions
    systemd-vconsole-setup.service loaded active exited Setup Virtual Console
    [email protected] loaded active running User Manager for UID 1000
    -.slice loaded active active Root Slice
    system-getty.slice loaded active active system-getty.slice
    system-netctl.slice loaded active active system-netctl.slice

    I tried adding "Requires=" still not working as planned. OVH dedicated box that had networking installed out of the box. I wonder if I need to do some tweaking there.  I just looked at boot log and services are starting before the network is up. Removed some lines to make it more readable. Dec 29 15:35:52 systemd[254]: Starting autodl screen irssi... is what I need to wait for network to be up before starting.
    Dec 29 15:35:52 systemd[254]: pam_unix(systemd-user:session): session opened for user by (uid=0)
    Dec 29 15:35:52 systemd[254]: Starting Paths.
    Dec 29 15:35:52 systemd[254]: Reached target Paths.
    Dec 29 15:35:52 systemd[254]: Starting Timers.
    Dec 29 15:35:52 systemd[254]: Reached target Timers.
    Dec 29 15:35:52 systemd[254]: Starting -.slice.
    Dec 29 15:35:52 systemd[254]: Created slice -.slice.
    Dec 29 15:35:52 systemd[254]: Starting Sockets.
    Dec 29 15:35:52 systemd[254]: Reached target Sockets.
    Dec 29 15:35:52 systemd[254]: Starting Basic System.
    Dec 29 15:35:52 systemd[254]: Reached target Basic System.
    Dec 29 15:35:52 systemd[254]: Starting autodl screen irssi...
    Dec 29 15:35:52 systemd[254]: Started autodl screen irssi.
    Dec 29 15:35:52 systemd[254]: Starting Default.
    Dec 29 15:35:52 systemd[254]: Reached target Default.
    Dec 29 15:35:52 systemd[254]: Startup finished in 156ms.
    Dec 29 15:35:57 network[294]: Starting network profile 'ovh_net_eth0'...
    Dec 29 15:35:57 kernel: IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
    Dec 29 15:35:58 kernel: e1000e: eth0 NIC Link is Up 100 Mbps Full Duplex, Flow Control: None
    Dec 29 15:35:58 kernel: e1000e 0000:01:00.0 eth0: 10/100 speed: disabling TSO
    Dec 29 15:35:58 kernel: IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
    Dec 29 15:36:00 network[294]: Started network profile 'ovh_net_eth0'

  • Systemd / services start but do not listen to interfaces

    Hello,
    In the course of migrating from initscripts to systemd (mixed systemd/sysvinit/initscripts), I am facing a strange behaviour with some services: squid, bind (named), dhcpd which start normally but do not listen to the useful interface. For instance, for named, netsat does not show  192.168.42.2:53 (which is is my LAN interface), despite the process is running (systemd status named). It seems that with systemd there is a change to the way available interfaces are reported to the services (for those services, I have not explicitly configured the interface to listen to).
    If I revert back to initscripts only (removing  init=/usr/lib/systemd/systemd from the kernel argument) everything is OK.
    I am not running NetworkManager (relevant ?), my rc.conf is clean apart that I am still using the deprecated syntax (I need a bridge interface that NetworkManager cannot handle).
    eth0="dhcp"
    eth1="eth1 promisc"
    br1="br1 192.168.42.2 netmask 255.255.255.0 broadcast 192.168.42.255"
    INTERFACES=(eth0 eth1 br1)
    Thanks for any help.

    mrechte wrote:
    I found the cause of the problem: legacy network service starts too late, after some other network daemons which do not see yet the interfaces.
    I switched to netcfg and dropped network.
    Seems to be OK now.
    Glad you found the problem. Would you please edit your first post and mark as "Solved" so others searching for this will see it?

  • Systemd service to run command before stopping connman.service?

    [This is my first time creating a thread, I apoligize if there is a more suitable category]
    Hello,
    I would like to run a command at shutdown before stopping a specific service (connman). I need the command to finish before stopping connman as well.
    Is there a good way to do this? I tried searching, but it seems systemd is a bit finnicky when it comes to shutdowns.
    I'd like to achieve this without modifying connman.service (Though this would probably work for me)
    What is the best way to do this?
    Thanks,
    Jacob
    Last edited by frash23 (2014-12-21 13:59:03)

    Hi
    I'm not sure if it would work, but from logic, creating a service file for your command with an "After=" dependency to connman might do it. Assuming that systemd passes the dependencies in reverse order when shutting down...
    Plus use "ExecStop=" to make your command execute at stopping.
    You gotta try this out.
    Regards
    Edit: To test/debug you can probably simply stop connman and see if it pulls the dep (instead of shutting down completely).
    Edit2: Maybe better better use "ExecStop=" inside the connman service files. As you mentioned you copy the original service file from /usr/lib/systemd/system to /etc/systemd/system and make your modifications there. This is the correct way to modify service files.
    Or then do it with a "config" directory, analog to how it's done here: https://wiki.archlinux.org/index.php/au … al_console
    Reference 'man systemd.service':
    ExecStop=
    Commands to execute to stop the service started via ExecStart=. This argument takes
    multiple command lines, following the same scheme as described for ExecStart= above. Use of
    this setting is optional. After the commands configured in this option are run, all
    processes remaining for a service are terminated according to the KillMode= setting (see
    systemd.kill(5)). If this option is not specified, the process is terminated immediately
    when service stop is requested. Specifier and environment variable substitution is
    supported (including $MAINPID, see above).
    Evtl. make sure your links in the .wants directory reference to the correct service file. (Disable and reenable once.)
    Last edited by rebootl (2014-12-21 16:51:18)

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

  • Systemd: some services starting too early and then failing

    Hello everyone,
    I freshly installed Arch on this new laptop (Asus Zenbook Prime UX32VD) and from the start, I wanted to have a pure systemd setup. I'm using services only and I've uninstalled initscripts and so far it's working relatively well.
    However, some services seem to start too early by default and the workarounds are unsatisfactory.
    Problem 1: asus-screen-brightness and asus-kbd-backlight
    On this lap top, the stock screen brightness buttons do not work (yet). A script and a service file (which are both available via the asus-screen-brightness AUR package) have to be used to allow users to change the brightness via the script. The problem is, with that service enabled, it only succeeds sometimes. About have of the time booting the laptop it fails, most likely because the necessary nodes in /sys/ do not exist yet. Restarting the service manually after booting does the trick:
    [root@tachychineta shapeshifter]# sc status asus-screen-brightness
    asus-screen-brightness.service - Allow user access to screen brightness
    Loaded: loaded (/etc/systemd/system/asus-screen-brightness.service; enabled)
    Active: active (exited) since Fri, 12 Oct 2012 11:23:44 +0200; 1min 1s ago
    Process: 320 ExecStart=/usr/bin/asus-screen-brightness allowusers (code=exited, status=0/SUCCESS)
    CGroup: name=systemd:/system/asus-screen-brightness.service
    Oct 12 11:23:44 tachychineta systemd[1]: Starting Allow user access to screen brightness...
    Oct 12 11:23:44 tachychineta sudo[349]: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/chmod g+w /sys/class/backlight/intel_backlight/brightness
    Oct 12 11:23:44 tachychineta sudo[349]: pam_unix(sudo:session): session opened for user root by (uid=0)
    Oct 12 11:23:44 tachychineta asus-screen-brightness[320]: cat: /sys/class/backlight/intel_backlight/max_brightness: No such file or directory
    Oct 12 11:23:44 tachychineta asus-screen-brightness[320]: /usr/bin/asus-screen-brightness: line 8: /10: syntax error: operand expected (error token is "/10")
    Oct 12 11:23:44 tachychineta asus-screen-brightness[320]: /usr/bin/asus-screen-brightness: line 10: 2*: syntax error: operand expected (error token is "*")
    Oct 12 11:23:44 tachychineta asus-screen-brightness[320]: cat: /sys/class/backlight/intel_backlight/brightness: No such file or directory
    Oct 12 11:23:44 tachychineta asus-screen-brightness[320]: chgrp: cannot access ‘/sys/class/backlight/intel_backlight/brightness’: No such file or directory
    Oct 12 11:23:44 tachychineta asus-screen-brightness[320]: chmod: cannot access ‘/sys/class/backlight/intel_backlight/brightness’: No such file or directory
    Oct 12 11:23:44 tachychineta systemd[1]: Started Allow user access to screen brightness.
    [root@tachychineta shapeshifter]# sc restart asus-screen-brightness
    [root@tachychineta shapeshifter]# sc status asus-screen-brightness
    asus-screen-brightness.service - Allow user access to screen brightness
    Loaded: loaded (/etc/systemd/system/asus-screen-brightness.service; enabled)
    Active: active (exited) since Fri, 12 Oct 2012 11:25:28 +0200; 2s ago
    Process: 2547 ExecStop=/usr/bin/asus-screen-brightness disallowusers (code=exited, status=0/SUCCESS)
    Process: 2579 ExecStart=/usr/bin/asus-screen-brightness allowusers (code=exited, status=0/SUCCESS)
    CGroup: name=systemd:/system/asus-screen-brightness.service
    Oct 12 11:25:28 tachychineta systemd[1]: Starting Allow user access to screen brightness...
    Oct 12 11:25:28 tachychineta sudo[2593]: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/chgrp users /sys/class/backlight/intel_backlight/brightness
    Oct 12 11:25:28 tachychineta sudo[2593]: pam_unix(sudo:session): session opened for user root by (uid=0)
    Oct 12 11:25:28 tachychineta sudo[2597]: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/chmod g+w /sys/class/backlight/intel_backlight/brightness
    Oct 12 11:25:28 tachychineta sudo[2597]: pam_unix(sudo:session): session opened for user root by (uid=0)
    Oct 12 11:25:28 tachychineta systemd[1]: Started Allow user access to screen brightness.
    Exactly the same problem occurs with asus-kbd-backlight.service which is needed to allow users to control the keyboard backlight. It also fails because of missing /sys/ entries if started too early.
    Problem 2: automatic login & X11
    I use the method described on the wiki to autologin into TTY1 with my user and my .bash_profile contains
    [[ $(fgconsole) = 1 ]] && startx
    and my .xserverrc is configured as explained in this fantastically useful article by falconindy.
    This way, X starts automatically and my session is properly authenticated for things like udiskie. I'm not using [testing] but instead rebuilt polkit with --enable-systemd and it's working just fine. The problem is, just like in problem 1, Xorg fails to start every now and then, failing with
    (EE) No devices detected.
    I don't have a full log because it hasn't happened in a while, but I'm very certain it's because the chipset isn't ready, yet.
    Solutions?
    I added "i915" to /etc/modules-load.d/static.conf hoping that would cover both the Xorg and backlight problems but it doesn't help. I then tried adding i915 to my MODULES in mkinitcpio.conf and rebuilding the initramfs and at least it looked like that way the problems went away but it added about 4 seconds to the time spent by the "kernel" during boot which is quite unacceptable. (Plots with and without i915 in MODULES).
    I read the systemd.unit and systemd.service man pages but I can't find a way to speficy required kernel modules for a service file. I'm not sure if specifying the modules in /etc/modules-load.d shouldn't be enough (because apparently it's supposed to load for sysinit.target, which is early) but apparently it isn't.
    Any ideas how I can get these services to work properly without sacrificing too much boot time?
    Thank you
    Last edited by Shapeshifter (2012-10-12 10:20:09)

    Please fill a bug report.

  • [solved] systemd services not starting at boot (or at all)

    On my router, some systemd services fail to start at boot.
    The services are :
    adsl (pppoe connetction on the wan interface)
    shorewall (funny again for a router)
    logind (brings up only tty1, and not the others with a 'timeout' error)
    adsl starts fine manually after booting up
    the others don't work, I have to launch shorewall with the old sysvinit rc script (and it works)
    I really don't know, what happened to logind...
    Last edited by scar (2012-11-30 10:20:44)

    cups: avahi client failed
    adsl: timeout (ppp0 running on eth0, the service did not found eth0)
    shorewall: did not work by the systemctl command, only with the old rc script
    I'm not sure if there was an error with logind, but I've had only tty1, not all the others (I have not touched /etc/inittab)
    since this was a very old install (but up to date), I've decided to reinstall the whole thing,
    Everything works
    (But reinstalling does not solve any problem, it erases the problems...)
    Last edited by scar (2012-11-30 10:21:20)

  • How to programatically start j2ee application/service  from command line

    Hi all
    We have developed a j2ee application and deployed  the .ear file on SAP J2EE (Netweaver'04) engine.
    We are able to successfully start/stop the application from Visual administrator -> Deploy -> Service -> Start application (or) Stop application.
    We need to start and stop the same application programatically or via command line instead of doing it from VA.  Any thoughts from anyone on how to do it ?
    Thanks in advance.
    Regards
    Nagesh

    The cammands are there in the respective folders, these are just the batch files / .sh scripts that can be run from command line.
    /usr/sap/<instance>JC<client>/j2ee/admin
    go.sh and go.bat can run either on command line
    j2ee/configtool
    configtool.sh / configtool.bat  
    similarly for other smaller utilities. For the main server, the related commands are in exe directory of sapmnt
    /sapmnt/<instance>/exe
    Regards,
    Nitin
    Edited by: Nitin Mahajan on Jun 16, 2009 11:16 PM

  • Cannot start mpd as systemd service

    Hi all,
    I have installed mpd. If I run
    mpd
    from a terminal, then everything is normal; I can open
    a client and use mpd. However, if I try to start it as a systemd service I get errors. That is, once I do
    sudo systemctl enable mpd
    and reboot, then
    jorge@flamingo:~$ systemctl status mpd
    ● mpd.service - Music Player Daemon
    Loaded: loaded (/usr/lib/systemd/system/mpd.service; enabled)
    Active: failed (Result: signal) since Thu 2014-09-25 22:01:48 EDT; 2min 20s ago
    Main PID: 1647 (code=killed, signal=ABRT)
    Sep 25 22:01:48 flamingo mpd[1647]: ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
    Sep 25 22:01:48 flamingo mpd[1647]: ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned erro...rectory
    Sep 25 22:01:48 flamingo mpd[1647]: ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
    Sep 25 22:01:48 flamingo mpd[1647]: ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM default
    Sep 25 22:01:48 flamingo mpd[1647]: alsa_output: Error opening default ALSA device: No such file or directory
    Sep 25 22:01:48 flamingo mpd[1647]: output: Attempting to detect a oss audio device
    Sep 25 22:01:48 flamingo mpd[1647]: oss_output: Error opening OSS device "/dev/dsp": No such file or directory
    Sep 25 22:01:48 flamingo mpd[1647]: oss_output: Error opening OSS device "/dev/sound/dsp": No such file or directory
    Sep 25 22:01:48 flamingo mpd[1647]: output: Attempting to detect a pulse audio device
    Sep 25 22:01:48 flamingo mpd[1647]: Assertion 'm' failed at pulse/thread-mainloop.c:236, function pa_threaded_mainloo...orting.
    Hint: Some lines were ellipsized, use -l to show in full.
    or,
    jorge@flamingo:~$ sudo systemctl start mpd
    [sudo] password for jorge:
    jorge@flamingo:~$ systemctl status mpd
    ● mpd.service - Music Player Daemon
    Loaded: loaded (/usr/lib/systemd/system/mpd.service; enabled)
    Active: failed (Result: signal) since Thu 2014-09-25 22:09:13 EDT; 8s ago
    Process: 2056 ExecStart=/usr/bin/mpd --no-daemon (code=killed, signal=ABRT)
    Main PID: 2056 (code=killed, signal=ABRT)
    Sep 25 22:09:13 flamingo mpd[2056]: ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
    Sep 25 22:09:13 flamingo mpd[2056]: ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned erro...rectory
    Sep 25 22:09:13 flamingo mpd[2056]: ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
    Sep 25 22:09:13 flamingo mpd[2056]: ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM default
    Sep 25 22:09:13 flamingo mpd[2056]: alsa_output: Error opening default ALSA device: No such file or directory
    Sep 25 22:09:13 flamingo mpd[2056]: output: Attempting to detect a oss audio device
    Sep 25 22:09:13 flamingo mpd[2056]: oss_output: Error opening OSS device "/dev/dsp": No such file or directory
    Sep 25 22:09:13 flamingo mpd[2056]: oss_output: Error opening OSS device "/dev/sound/dsp": No such file or directory
    Sep 25 22:09:13 flamingo mpd[2056]: output: Attempting to detect a pulse audio device
    Sep 25 22:09:13 flamingo mpd[2056]: Assertion 'm' failed at pulse/thread-mainloop.c:236, function pa_threaded_mainloo...orting.
    Hint: Some lines were ellipsized, use -l to show in full.
    Here is the mpd config file:
    jorge@flamingo:~$ cat ~/.mpd/mpd.conf
    music_directory "/home/jorge/Multimedia/Audio/Music"
    playlist_directory "/home/jorge/.mpd/playlists"
    db_file "~/.mpd/mpd.db"
    log_file "~/.mpd/mpd.log"
    pid_file "~/.mpd/mpd.pid"
    state_file "~/.mpd/mpdstate"
    audio_output {
    type "alsa"
    name "MPD"
    restore_paused "yes"
    follow_inside_symlinks "no"
    Any ideas what I'm doing wrong here?
    Thanks in advance.
    Last edited by geo909 (2014-09-26 02:12:30)

    Scimmia wrote:Yeah, you're out of date. Update your system and everything should work.
    *facepalm*
    Oh dear.. An update fixed the problem indeed, thank you.
    HilmTye wrote: if you're starting mpd as a system service, then your user's config won't be used
    You're right.. I just read the wiki more carefully. Indeed, I would like to run it for my user, so systemd is not
    the best option for me. But I still have trouble.. The problem is that I can't autostart it the way it mentions
    in the wiki. My mpd files are as follows:
    jorge@flamingo:~$ ls ~/.mpd
    mpd.conf mpd.db mpd.log mpd.pid mpdstate playlists
    I tried this as per the wiki:
    jorge@flamingo:~$ cat ~/.profile
    # MPD daemon start (if no other user instance exists)
    [ ! -s ~/.mpd/mpd.pid ] && mpd
    but it didn't work. mpd was not running after reboot.
    Then I tried /etc/profile:
    jorge@flamingo:~$ cat /etc/profile
    # /etc/profile
    #Set our umask
    umask 022
    # Set our default path
    PATH="/usr/local/sbin:/usr/local/bin:/usr/bin"
    export PATH
    # Load profiles from /etc/profile.d
    if test -d /etc/profile.d/; then
    for profile in /etc/profile.d/*.sh; do
    test -r "$profile" && . "$profile"
    done
    unset profile
    fi
    # Source global bash config
    if test "$PS1" && test "$BASH" && test -r /etc/bash.bashrc; then
    . /etc/bash.bashrc
    fi
    # Termcap is outdated, old, and crusty, kill it.
    unset TERMCAP
    # Man is much better than us at figuring this out
    unset MANPATH
    export GPODDER_HOME="/home/jorge/Applications/Application Data/gpodder"
    # MPD daemon start (if no other user instance exists)
    [ ! -s ~/.mpd/mpd.pid ] && mpd
    but it didn't work either.
    In both cases, if I try to run mpd again from the terminal, I get:
    jorge@flamingo:~$ mpd
    server_socket: bind to '0.0.0.0:6600' failed: Address already in use (continuing anyway, because binding to '[::]:6600' succeeded)
    and then mpd works.
    Any ideas on how to startup mpd automatically on boot without systemd?
    Last edited by geo909 (2014-09-26 04:03:15)

  • [SOLVED] systemd : services failing to start on boot

    I have removed sysvinit completely as per the systemd wiki pages.
    I don't usually re-boot very often so I'm not sure exactly when the problem started.
    I only noticed this problem about 4 or 5 days ago.
    But now whenever I reboot my machine 2 services fail consistently.
    adsl.service
    colord.service
    They both start flawlessly once I can log in at a console.
    I'm using kde and in the last couple of days, while trying to fix my problem, the kdm service has failed to start a couple of times too - saying there is no X server.
    Before switching to systemd I never had any of these problems using the old rc.conf method. My DAEMONS array had the adsl service start after the network service.
    I need some help and advice to find out what is causing the problem and how to fix it.
    Last edited by bhrgunatha (2012-10-25 05:44:22)

    Thanks. That seems plausible. So I've been snooping at the journal.
    journalctl -ab
    Oct 25 17:06:13 starch systemd[1]: Started Trigger Flushing of Journal to Persistent Storage.
    Oct 25 17:06:14 starch systemd[1]: Started Recreate Volatile Files and Directories.
    Oct 25 17:06:14 starch systemd[1]: Starting System Initialization.
    Oct 25 17:06:14 starch systemd[1]: Reached target System Initialization.
    Oct 25 17:06:14 starch systemd[1]: Starting CUPS Printing Service Sockets.
    Oct 25 17:06:14 starch systemd[1]: Listening on CUPS Printing Service Sockets.
    Oct 25 17:06:14 starch systemd[1]: Starting Console System Startup Logging...
    Oct 25 17:06:14 starch systemd[1]: Starting Restore Sound Card State...
    Oct 25 17:06:14 starch systemd[1]: Starting CUPS Printer Service Spool.
    Oct 25 17:06:14 starch systemd[1]: Started CUPS Printer Service Spool.
    Oct 25 17:06:14 starch systemd[1]: Starting D-Bus System Message Bus Socket.
    Oct 25 17:06:16 starch ntpd[381]: ntpd [email protected] Tue Aug 21 15:06:24 UTC 2012 (1)
    Oct 25 17:06:16 starch ntpd[413]: proto: precision = 0.156 usec
    Oct 25 17:06:17 starch ntpd[413]: ntp_io: estimated max descriptors: 1024, initial socket boundary: 16
    Oct 25 17:06:17 starch ntpd[413]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
    Oct 25 17:06:18 starch ntpd[413]: Listen and drop on 1 v6wildcard :: UDP 123
    Oct 25 17:06:18 starch ntpd[413]: Listen normally on 2 lo 127.0.0.1 UDP 123
    Oct 25 17:06:18 starch ntpd[413]: Listen normally on 3 lo ::1 UDP 123
    Oct 25 17:06:18 starch ntpd[413]: peers refreshed
    Oct 25 17:06:18 starch ntpd[413]: Listening on routing socket on fd #20 for interface updates
    Oct 25 17:06:18 starch dbus[384]: [system] Activating systemd to hand-off: service name='org.freedesktop.ColorManager' unit='colord.service'
    Oct 25 17:06:18 starch dbus[384]: [system] Successfully activated service 'org.freedesktop.systemd1'
    Oct 25 17:07:03 starch dbus[384]: [system] Successfully activated service 'org.freedesktop.ColorManager'
    Oct 25 17:07:03 starch dbus[384]: [system] Activating via systemd: service name='org.freedesktop.ColorManager' unit='colord.service'
    Oct 25 17:07:03 starch dbus[384]: [system] Successfully activated service 'org.freedesktop.ColorManager'
    Oct 25 17:07:04 starch kernel: r8169 0000:02:00.0: eth0: link down
    Oct 25 17:07:03 starch systemd[1]: Starting Manage, Install and Generate Color Profiles...
    Oct 25 17:07:03 starch systemd[1]: Started Manage, Install and Generate Color Profiles.
    Oct 25 17:07:03 starch systemd[1]: colord.service: main process exited, code=killed, status=6
    Oct 25 17:07:03 starch systemd[1]: Unit colord.service entered failed state.
    Oct 25 17:07:04 starch kernel: r8169 0000:02:00.0: eth0: link down
    Oct 25 17:07:04 starch kernel: IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
    Oct 25 17:07:04 starch kernel: PPP generic driver version 2.4.2
    Oct 25 17:07:04 starch cupsd[380]: Unknown directive DefaultAuthType on line 26.
    Oct 25 17:07:04 starch kernel: r8169 0000:02:00.0: eth0: link up
    Oct 25 17:07:04 starch kernel: IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
    Oct 25 17:07:04 starch pppoe-start[382]: TIMED OUT
    Oct 25 17:07:04 starch kernel: NET: Registered protocol family 24
    Oct 25 17:07:04 starch pppoe-start[382]: /usr/sbin/pppoe-start: line 193: 394 Terminated $CONNECT "$@" > /dev/null 2>&1
    That seems to confirm your theory.
    eth0 link is not up when attempting to start colord and adsl
    So the $64,000 question:
    How do I defer them until eth0 is ready?
    Or how can I force the eth0 link to be up before colord or adsl try to use it?
    Last edited by bhrgunatha (2012-10-25 01:33:36)

  • How to change daemon (service) start order by systemd?

    how to change daemon (service) start order by systemd? I want getty start after all other service have been started.

    hoanglan87 wrote:If you do that, you'll not see services messages when booting.
    That's the whole point. Once your system's working fine, you don't need to slow your boot down with those messages. You can always get them back by hitting the "e" key (with Grub) and editing the kernel boot line. Unless you've set your time-out to 0, which is probably not a good idea for most of us. Those service messages don't seem to be logged anywhere (although, there's lots of other logging you can enable). Anyway, we're thread-drifting here, sorry.

  • [SOLVED] systemd service not starting

    Hi,
    Been using Arch for just over a week now moving from Ubuntu and loving it. Achieved so much more on Arch in this short time until this evening.
    I am trying to run a shell script at startup. I added the service file under /etc/systemd/system/myapp.service
    With the following content:
    [Unit]
    Description=Notification
    [Service]
    ExecStart=/usr/bin/myscript
    [Install]
    WantedBy=multi-user.target
    As it is I can run "systemctl restart myapp.service" and the script execute flawlessly however on reboot it does nothing and I get this error when I run systemctl status myapp.service:
    systemctl status myapp.service
    myapp.service - Notification
       Loaded: loaded (/etc/systemd/system/myapp.service; enabled)
       Active: failed (Result: exit-code) since Thu 1970-01-01 10:00:08 EST; 14s ago
      Process: 116 ExecStart=/usr/bin/myscript (code=exited, status=6)
    Other info:
    Script starts with #!/bin/sh
    Script permissions 755
    Tried adding After=network.target under unit.
    Tried Type=oneshot and forking
    O yes /var/log/messages.log | grep myapp
    Sep  6 14:25:56 alarm systemd[1]: [/etc/systemd/system/myapp.service:1] Unknown section 'unit'. Ignoring.
    Sep  6 14:25:56 alarm systemd[1]: [/etc/systemd/system/myapp.service:2] Assignment outside of section. Ignoring.
    Jan  1 01:00:11 alarm systemd[1]: myapp.service: main process exited, code=exited, status=6/NOTCONFIGURED
    Jan  1 01:00:11 alarm systemd[1]: Unit myapp.service entered failed state.
    Jan  1 01:00:11 alarm [    3.243318] systemd[1]: [/etc/systemd/system/myapp.service:1] Unknown section 'unit'. Ignoring.
    Jan  1 01:00:11 alarm [    3.243490] systemd[1]: [/etc/systemd/system/myapp.service:2] Assignment outside of section. Ignoring.
    Only thing I dont get is the date difference? I have set the timezone correctly..
    Any suggestions?
    thanks
    Last edited by blueteq (2013-09-10 10:01:11)

    Reaching the network.target does not necessarily mean that an active connection has been reached.  For example, if you use wicd or netctl-auto, it will report the stating of the service as successful after the daemon itself has started, but starting the daemon simply means that it is ready to start scanning for wireless networks and then connect.
    If you want to be absolutely sure that there is a network connection before the service starts, you should use NetworkManager.service.  That will also pull in the NetworkManager-wait-online.service which will not complete until a full connection has been reached.  At that point the startup will have reached the network-online.target.  So you should order the service after that instead.  In reality, you should order it after that anyway, no matter what netowrk connection service you use, as that is a built in target to systemd.
    Even though you have the RestartSec=35 and Restart=on-failure (which is a sane thing to do IMO), it is probably a good idea to order it After=netowrk-online.target anyway, as that will cause the service to start a bit later and at least attempt to order itself correctly.  That way it will also ensure that the service is stopped before the network is taken down as well, hopefully ensuring a clean disconnect as well.

  • Executing 2nd command after server rebooted & related services started

    hi friends
    i am creating a PS script containg two lines:
    the first line executes dcpromo /unattend:c:\answerfile.txt to create a new domain controller
    the second line will disable domain password complexity which is: 
    set-executionPolicy -identity mydomain.lab -complexityenabled $false -minimumpasslength 5
    the problem is i need after first line of the script, executed, server be rebooted & the 2nd line 
    be executed after server rebooted & whey AD services started, this script continue to run the next line.
    is it ossible in powershell?
    thanks in advanced

    You won't be able to do that in the same script.
    You can use a second script that waits for the AD services to start, and then sets the password policies and run that script after the restart using the RunServicesOnce key:
    https://support.microsoft.com/kb/179365?wa=wsignin1.0
    Use the first script to set that key and then do the restart after the DC promo is finished.
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
    hi again. thanks
    in addition i found that the powershell workflow is better way to that
    regards

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

Maybe you are looking for

  • Error in MIGO with reference of PO

    Hi, I am doing MIGO with reference of purchase order and getting error. Sales price for 000000000000000694 could not be found Message no. M7158 Diagnosis The sales price valuation is active in the valuation area. The system could not determine a sale

  • Only prints black and white

    my sisters brand new Envy 5660 printer only prints in black and white. i've been all over the net and my iMac trying to figure out what the problem, but to no avail. i've looked for the paper type/ quality etc settings that were soloutions to other p

  • How to make form fields "Clickable"

    Hey Guys, I created a Fillable PDF Form with Form fields using ADOBE Acrobat 9.0 Pro-Ex + LiveCycle Designer for Windows XP. My question is when you create a form, is there a way to make form fields "clickable" instead of just auto-tab? Because if yo

  • Apps will not open after upgrading to ios5

    I just upgraded my iPad 1 today, with the new ios5 system. Now I cannot get most of my apps to open up. They just blink once, but do nothing else when I tap on them ?

  • HT4623 i have tried to update my iphone 4...its not allowing me to update!

    please assist me on updating my phone, i have tried numerous times & its not working!