Systemd-cron: minimal cron replacement with systemd

systemd-cron
systemd-cron is a set of systemd unit files that take advantage of systemd's timer units and calendar events to execute scripts in the standard cron.hourly, cron.daily, cron.weekly, and cron.monthly directories. For simple setups where this is all you need, this allows you to not have to run a cron daemon. Of course this also means it is not a drop-in replacement for a traditional cron daemon and you will not get support for:
crontab files
per-user jobs
executing missed jobs
emailing job output
et cetera
To use, stop and uninstall any existing cron daemon and install the AUR package. Then as root run:
# systemctl enable cron.target
# systemctl start cron.target
Please note the .target suffix.
More details are available with:
$ man systemd.cron
I have been using it successfully on my servers for a week now with no troubles.

nbvcxz wrote:Haven't tested jet but really nice idea - thumbs up. Any possibilities to make per user jobs in the future?
That would probably be the next thing I do. As Morrad described above it should be pretty natural with systemd user sessions. After that probably crontab support using generators.

Similar Messages

  • Completely replacing consolekit with systemd?

    I noticed on the systemd wiki it says its now possible to replace the now un-maintained consolekit's functionality with systemd, but I had some concerns before trying it, and was wondering if anyone has tried this yet.
    1. I noticed the polkit-systemd package in the aur is marked out of date since june. Should I just build it myself with the abs?
    2. GDM and Gnome-Session still seem to require consolekit to be installed, if I have a systemd enabled polkit will they still try and use consolekit, or do they just support both at runtime?

    bwat47 wrote:
    installed tomegun's polkit and removed consolekit using Rdd as suggested by Runiq. Seems to be working fine, I can mount removable drivers, smb shares etc.. in nautilus and gdm works fine. However after doing this for some strange reason the gnome-shell networkmanager applet is showing the wired connection icon (computer screen) when I am connected to wireless instead of the wireless bars (otherwise the applet is working totally fine). Not sure if removing consolekit caused it or the polkit package, not a big deal though.
    EDIT: I also can't access the advanced networking options in the gnome network settings now, its greyed out. Perhaps gnome still has some bugs with systemd only setup.
    A clarification: I just recompiled polkit with ABS (version 0.105 vs. tomegun's 0.107). At first I also recompiled gdm and gnome-session, found that everything worked, and worked my way back to a minimal working version. I eventually ended up using the recompiled gdm and gnome-session packages, though; but that was mainly to get pacman to shut up about the unresolved consolekit dependency.
    ANOKNUSA wrote:still can't mount anything.  I'm not sure where to start debugging
    How do you mount things? I'm using a custom Python script that runs udisks over dbus in the background, so I need a working udisks.service and a working dbus session bus (check for DBUS_SESSION_BUS_ADDRESS and, for good measure, see that loginctl shows an active session for your user).
    Last edited by Runiq (2012-09-01 16:23:29)

  • Replacing consolkit's function with systemd

    The arch wiki says that it is possible to replace consolekit's function with systemd.
    https://wiki.archlinux.org/index.php/Sy … r_sessions
    Has anyone already done this? I guess there are other packages which have to be recompiled? e.g. gdm and gnome-session, since they depend on consolekit.
    As i'm already using systemd i'd like to give it a try, but i'd feel more comfortable with a howto
    So if anyone has an idea where to find one, i'd appreciate that.
    Regards,
    Robert

    Aside from changing the type of data you put on the Time Capsule, leave its drive as is. Its format is fixed.
    (119920)

  • [Solved]No active session with systemd-logind

    I've read all the posts on the forum about sytemd and active sessions but I can't seem to get it working.
    I'm on a up to date Arch, complete systemd. I'm using GDM as DM and latest version of Gnome.
    Output of loginctl show-session $XDG_SESSION_ID
    1 Id=2
    2 Timestamp=Sun 2013-02-03 21:53:16 CET
    3 TimestampMonotonic=14881075
    4 DefaultControlGroup=name=systemd:/user/peter/2
    5 VTNr=0
    6 Display=:0
    7 Remote=no
    8 Service=gdm-password
    9 Leader=2712
    10 Audit=2
    11 Type=x11
    12 Class=user
    13 Active=no
    14 State=online
    15 KillProcesses=no
    16 IdleHint=no
    17 IdleSinceHint=0
    18 IdleSinceHintMonotonic=0
    19 Name=peter
    Output of systemctl list-unit-files |grep enabled
    cups.path enabled
    acpid.service enabled
    chrony.service enabled
    cronie.service enabled
    cups.service enabled
    dbus-org.freedesktop.NetworkManager.service enabled
    display-manager.service enabled
    dkms.service enabled
    gdm.service enabled
    [email protected] enabled
    httpd.service enabled
    lm_sensors.service enabled
    mysqld.service enabled
    NetworkManager.service enabled
    postfix.service enabled
    preload.service enabled
    rsyslog.service enabled
    syslog.service enabled
    systemd-readahead-collect.service enabled
    systemd-readahead-drop.service enabled
    systemd-readahead-replay.service enabled
    thinkfan.service enabled
    tlp-init.service enabled
    tomcat6.service enabled
    [email protected] enabled
    unload.service enabled
    upower.service enabled
    acpid.socket enabled
    cups.socket enabled
    remote-fs.target enabled
    Output of ls -lR /etc/systemd/system
    /etc/systemd/system:
    total 52K
    drwxr-xr-x 2 root root 4.0K Nov 1 22:52 cryptsetup.target.wants/
    lrwxrwxrwx 1 root root 46 Sep 24 22:02 dbus-org.freedesktop.NetworkManager.service -> /usr/lib/systemd/system/NetworkManager.service
    drwxr-xr-x 2 root root 4.0K Feb 3 21:42 default.target.wants/
    lrwxrwxrwx 1 root root 35 Jan 28 23:33 display-manager.service -> /usr/lib/systemd/system/gdm.service
    drwxr-xr-x 2 root root 4.0K Nov 8 09:10 getty.target.wants/
    drwxr-xr-x 2 root root 4.0K Nov 3 20:36 graphical.target.wants/
    drwxr-xr-x 2 root root 4.0K Jan 13 16:58 local-fs.target.wants/
    drwxr-xr-x 2 root root 4.0K Feb 3 21:42 multi-user.target.wants/
    drwxr-xr-x 2 root root 4.0K Oct 9 09:49 printer.target.wants/
    -rw-r--r-- 1 root root 216 Feb 3 21:09 rc-local.service
    drwxr-xr-x 2 root root 4.0K Nov 7 23:28 shutdown.target.wants/
    drwxr-xr-x 2 root root 4.0K Nov 3 20:43 sockets.target.wants/
    drwxr-xr-x 2 root root 4.0K Jan 13 16:58 sysinit.target.wants/
    lrwxrwxrwx 1 root root 39 Nov 3 20:39 syslog.service -> /usr/lib/systemd/system/rsyslog.service
    drwxr-xr-x 2 root root 4.0K Feb 3 21:42 system-update.target.wants/
    -rw-r--r-- 1 root root 166 Nov 7 23:28 unload.service
    /etc/systemd/system/cryptsetup.target.wants:
    total 0
    lrwxrwxrwx 1 root root 42 Nov 1 22:52 [email protected] -> /usr/lib/systemd/system/[email protected]
    /etc/systemd/system/default.target.wants:
    total 0
    lrwxrwxrwx 1 root root 57 Feb 3 21:42 systemd-readahead-collect.service -> /usr/lib/systemd/system/systemd-readahead-collect.service
    lrwxrwxrwx 1 root root 56 Feb 3 21:42 systemd-readahead-replay.service -> /usr/lib/systemd/system/systemd-readahead-replay.service
    /etc/systemd/system/getty.target.wants:
    total 0
    lrwxrwxrwx 1 root root 38 Nov 8 09:10 [email protected] -> /usr/lib/systemd/system/[email protected]
    /etc/systemd/system/graphical.target.wants:
    total 0
    lrwxrwxrwx 1 root root 40 Sep 26 22:31 tlp-init.service -> /usr/lib/systemd/system/tlp-init.service
    lrwxrwxrwx 1 root root 38 Nov 3 20:36 upower.service -> /usr/lib/systemd/system/upower.service
    /etc/systemd/system/local-fs.target.wants:
    total 0
    /etc/systemd/system/multi-user.target.wants:
    total 0
    lrwxrwxrwx 1 root root 37 Nov 3 20:43 acpid.service -> /usr/lib/systemd/system/acpid.service
    lrwxrwxrwx 1 root root 38 Nov 7 23:10 chrony.service -> /usr/lib/systemd/system/chrony.service
    lrwxrwxrwx 1 root root 38 Sep 24 22:04 cronie.service -> /usr/lib/systemd/system/cronie.service
    lrwxrwxrwx 1 root root 33 Oct 9 09:49 cups.path -> /usr/lib/systemd/system/cups.path
    lrwxrwxrwx 1 root root 36 Oct 11 18:03 dkms.service -> /usr/lib/systemd/system/dkms.service
    lrwxrwxrwx 1 root root 37 Sep 26 18:54 httpd.service -> /usr/lib/systemd/system/httpd.service
    lrwxrwxrwx 1 root root 42 Jan 14 22:47 lm_sensors.service -> /usr/lib/systemd/system/lm_sensors.service
    lrwxrwxrwx 1 root root 38 Nov 8 10:53 mysqld.service -> /usr/lib/systemd/system/mysqld.service
    lrwxrwxrwx 1 root root 46 Sep 24 22:02 NetworkManager.service -> /usr/lib/systemd/system/NetworkManager.service
    lrwxrwxrwx 1 root root 39 Oct 3 12:00 postfix.service -> /usr/lib/systemd/system/postfix.service
    lrwxrwxrwx 1 root root 39 Oct 1 23:21 preload.service -> /usr/lib/systemd/system/preload.service
    lrwxrwxrwx 1 root root 40 Jan 13 16:58 remote-fs.target -> /usr/lib/systemd/system/remote-fs.target
    lrwxrwxrwx 1 root root 39 Nov 3 20:39 rsyslog.service -> /usr/lib/systemd/system/rsyslog.service
    lrwxrwxrwx 1 root root 40 Sep 24 22:21 thinkfan.service -> /usr/lib/systemd/system/thinkfan.service
    lrwxrwxrwx 1 root root 39 Oct 5 16:27 tomcat6.service -> /usr/lib/systemd/system/tomcat6.service
    /etc/systemd/system/printer.target.wants:
    total 0
    lrwxrwxrwx 1 root root 36 Oct 9 09:49 cups.service -> /usr/lib/systemd/system/cups.service
    /etc/systemd/system/shutdown.target.wants:
    total 0
    lrwxrwxrwx 1 root root 34 Nov 7 23:28 unload.service -> /etc/systemd/system/unload.service
    /etc/systemd/system/sockets.target.wants:
    total 0
    lrwxrwxrwx 1 root root 36 Nov 3 20:43 acpid.socket -> /usr/lib/systemd/system/acpid.socket
    lrwxrwxrwx 1 root root 35 Oct 9 09:49 cups.socket -> /usr/lib/systemd/system/cups.socket
    /etc/systemd/system/sysinit.target.wants:
    total 0
    /etc/systemd/system/system-update.target.wants:
    total 0
    lrwxrwxrwx 1 root root 54 Feb 3 21:42 systemd-readahead-drop.service -> /usr/lib/systemd/system/systemd-readahead-drop.service
    The solution posted here https://bbs.archlinux.org/viewtopic.php … 0#p1186900 with the rc.local compatubility service does work in a way. I created an empty rc.local file and made it executable. Now GDM is not starting until I hit CTRL-C, and after that my session is active!
    I use the latest version of Polkit and initscripts is not installed.
    Any tip is welcome!
    Last edited by pgrond (2013-02-24 17:55:31)

    I've read that post but I can't get it fixed. I don't need any rc-local compatibility. I'm on a complete systemd system, so I don't get why I would need this.
    If I create a dummy rc-local service GDM won't start. But after a CTRL-C it will start and the session is active. Can it be some sort of race condition?
    Or can it be a problem that my home partition is encrypted and mounted on login?

  • Gnome and kde not loading with systemd

    Hello!
    I use [testing] repo and after some updates i can't use gnome or kde with systemd anymore.
    * with sysvinit everything works
    * xfce and other wms works fine with systemd and sysv
    * 'gnome-shell --replace' also work in xfce with systemd
    * I've got some errors:
    gnome-session[2301]: WARNING: Application 'gnome-settings-daemon.desktop' failed to register before timeout
    (gnome-settings-daemon:2321): libupower-glib-WARNING **: Couldn't enumerate devices: Activation of org.freedesktop.UPower timed out
    gnome-session[2301]: WARNING: Application 'gnome-shell.desktop' failed to register before timeout
    (gnome-settings-daemon:2321): color-plugin-WARNING **: GDBus.Error:org.freedesktop.ColorManager.Failed: failed to obtain org.freedesktop.color-manager.create-profile auth
    QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
    Object::connect: No such signal QDBusAbstractInterface::DeviceAdded(QString)
    plasma-desktop(2323): Communication problem with  "plasma-desktop" , it probably crashed.
    Error message was:  "org.freedesktop.DBus.Error.Disconnected" : " "Connection was disconnected before a reply was received" "
    I think there is some problems with dbus...

    Without a dbus socket, dbus probably isn't running. It's supposed to be started automatically when a program needs it. Check to see that it is installed and running:
    pacman -Q dbus
    pgrep -l dbus
    Dbus won't run without hal, so hal should be in:
    tail /etc/rc.conf
    Are any of your partitions full?
    df -h
    For the other error, it looks like libdrm isn't installed, but I don't think you need it if you're running the nvidia driver.
    Your xorg.conf and Xorg.0.log would also be useful. Also check dmesg for errors.
    And see if /etc/rc.d/dbus is marked executable.
    Last edited by fphillips (2009-05-12 18:27:41)

  • Help with systemd problems/reply to closed thread

    @Everyone; as the previopus topic was closed, I am opening a new one here, partly to reply to some things that was said to me in the previous thread/topic (and I do not like to leave people hanging), but mainly to try and get some help with my systemd config (that I was not able to find help with in the wiki or manpages).
    @czubek; eww, that sounds rather similiar to some other operating systems I've heard of (not just, but obviously including, windows)... For me, subjectively, that is not very attractive, as being able to have a single application do a single thing, and then mixing and matching as I personally see fit is a great thing.
    @tomegun: I can indeed see your point, but if I made direct quotes on all the things I reply too, my posts would reach biblical proportions.
    Mmm-hmm, I do indeed know of "the Arch Way"; however, the system that you expose can be of varying complexity as well, and I found that the system that was presented to me by way of Sysvinit/initscripts was a way simpler system than that presented to me by systemd.
    Indeed, and I do like that; I enjoy knowing how my system works and learning more about it; however, the truth is that reading manpages and the wiki isn't always enough. And I use the numbers instead of letters in certain places as a jest, please, do not get offended by that; if you have to, get offended by my opinions.
    Ah, I have now scanned the wiki, the manpages, and have already faced problems. While part of me is saddened by this fact (as I was hoping for a smooth transition to systemd), part of me is glad that I can at least prove that everything isn't quite as simple as some people would make it out to be. More on this later in this post, as I do need help with the problems I have faced.
    And I wouldn't say that the new and old way are equally trivial, as I immediatley faced problems with "the new way". More on this later.
    Ok, I find that if the debate is polarized, then there is nothing wrong with describing it as such. I spell what I see.
    Oh my... Ignored as a matter of principle? I would say that that is an excellent way to stagnate; by that logic, moviemakers, gamemakers etcetera should ignore any and all criticism they recieve, as the critics are not contributing.... Wouldn't that lead to a complete halt in development? Isn't criticism (so long as it is constructive, obviously) a key component of (media/software) evolution?
    Ah, I see, then I  misunderstood the current state of the install media
    "Some adjustements"... Well, I guess we'll have to see how that goes, then. Hopefully it'll be smooth.
    @Everyone; Awebb possesses stunning accuracy as far as his observations go.
    @zb3; My point exactly.
    @tomegun; I believe you to be wrong; complaining (but not whining) is the first step towards improvement, as I think that I and zb3 has shown.
    Further, your last point (where you talk about "deep understanding of Y" and whatnot) is basically saying that only devs and programmers can contribute, so zb3's observation would be correct.
    Also, making suggestions is part of constructive criticism; you can do that even if you can't code, e.g. by saying "X works badly because it makes Y crash; couldn't we replace X with something akin to Z?". This is a valid point even if you have no intricate understanding of X, Y or Z, and if it is impossible to replace X for one reason or the other, it's not hard to reply with "Replacing X is impossible because of reason Q", and then see if someone can solve reason Q etcetera.
    zb3's example is obviously helping; for one, it would allow people to know taht they can't boot with systemd in certain cases, or that installing/runing systemd can break their system. I would consider that rather important information.
    @Everyone; Now then, to see if I can (or rather, if I can get help to) shed some light on some problems I've been having.
    My transition to systemd went pretty smooth (besides the fact that I couldn't use 'systemctl' to set anything, and neither duckduckgo nor any posts in the forums could help me (the error I continously got was "Failed to issue method call: Launch helper exited with unknown return code 1") and that there are no manpages/tips on how to configure the files for "localtime" and "adjtime", which would've been good considering some syntax have changed) to about halfway through, to the point where I was supposed to start using systemd for my daemons.
    Now then, to the main problem; first, I tried running
    "systemctl enable syslog-ng.service"
    and got the following message;
    "ln -s '/usr/lib/systemd/system/syslog-ng.service' '/etc/systemd/system/syslog.service'
    ln -s '/usr/lib/systemd/system/syslog-ng.service' '/etc/systemd/system/multi-user.target.wants/syslog-ng.service'"
    Since it doesn't exclusively say that something went wrong (at least as far as I can understand), I pondered the message a bit, but moved on to try and start dbus by issuing
    "systemctl enable dbus.service",
    to which I got the reply
    "The unit files have no [Install] section. They are not meant to be enabled using systemctl."
    This I can only assume is an error message of some sort, especially seeing as it says "not meant to be enabled using systemctl", but the wiki rather explicitly states that that is what I am supposed to do.
    I dare not move on (or attempt to start other daemons) without further advice, as I fear I might break my system. Any ideas as to how to solve this would be greatly appreciated.

    tcmdvm wrote:
    The message;
    "ln -s '/usr/lib/systemd/system/syslog-ng.service' '/etc/systemd/system/syslog.service'
    ln -s '/usr/lib/systemd/system/syslog-ng.service' '/etc/systemd/system/multi-user.target.wants/syslog-ng.service'"
    indicates that running "systemctl enable syslog.service" is now enabled.
    If you try running sytemtctl enable <whatever>.service and get
    "The unit files have no [Install] section. They are not meant to be enabled using systemctl." means there is no <whatever>.service file available to enable.
    The dbus.service as far as I know is already enabled when installing systemd and doesn't require any action.
    Ah, right, systemd is chatty (I'm of the old skool; if nothing is/goes wrong, a program should keep quiet).
    Oh ok, then I should dare more on.
    ZekeSulastin wrote:To be a bit more precise, it means the service is there but it's only used as a dependency for something else; the [Install] section of the file is what tells systemctl where to link it and such.  Also, where exactly in the wiki were you told explicitly to 'systemctl enable dbus.service'?  I can easily point you to the sections in both installation guides that tell you how to set things like /etc/localtime et. al (also `man 7 archlinux`), but not the one that said to manually enable dbus.
    Ah, I see; and well, I was told right here, going from the top, to "Enable Daemons formerly listed in rc.conf [...] For a translation of the daemons from /etc/rc.conf to systemd services, see: List of Daemons and Services.", and, using the list, dbus is mentioned there, as you can see. Since I started from the top, I did not know that you didn't need to enable that service. Perhaps it could be added to the descriptions of the relevant services in the Wiki which ones are autostarted?
    ZekeSulastin wrote:Lastly, I don't think trying to continue conversations from a closed thread is a very good idea, let alone doing it in a giant undivided wall of text that makes it quite difficult to pick out much any single topic.
    Meh, I directly refer to the relevant people, they can easily see their own old posts in the previous thread, etcetera... I think te ones who have something to say will be able to find my replies to their previous statements (or so I hope). For now, as everyone can see, I quote stuff (but man might I make some huge posts if I ever post again in the future, if I quote what I reply to).
    fsckd wrote:This is not really a technical support subforum. Moving from Arch Discussion to Newbie Corner.
    Ah ok, thanks (or perhaps a cautious thanks? Moving it to "newbie corner" might, after all, be a subtle insult...).
    tomegun wrote:It is not really possible to follow your message as you don't quote what you are replying to. Moreover, as the thread was closed I think that means we should stop the discussion ;-)
    Hmm, I think it means cop-out for lack or proper arguments/responses... But ok, I'll let it slide, for now (mainly as I can't do much else).
    tomegun wrote:You are not meant to enable dbus.service as it is enabled unconditionally. To check the enabled/disabled state of your services try "systemctl list-unit-files". "static" means that you are not supposed to enabled/disable it.
    Ah ok, thank you. Now, having abandoned all hope, I'll start configuring again and see how it goes... May the void protect me. If I die, grieve not for me, but remember me in the fight against hard-to-configure applications.
    (edit/addon)
    Actually, what am I supposed to do with "hwclock"? the List of Daemons only says that I shouldn't run that in tandem with ntpd, but I'm not running ntpd, so... How do I get hwclock with systemd?
    Edited for additional question.
    Last edited by incassum (2012-11-07 08:44:42)

  • [solved] Cannot activate wake on lan with systemd

    I have activated successfully wake on lan with systemd, following these guidelines :
    https://wiki.archlinux.org/index.php/Wol#With_systemd
    My [email protected] is:
    [Unit]
    Description=Wake-on-LAN for %i
    Requires=network.target
    After=network.target
    [Service]
    ExecStart=/usr/bin/ethtool -s %i wol g
    Type=oneshot
    [Install]
    WantedBy=multi-user.target
    It worked nicely until I recently had to reinstall my server (following a disk replacement). Since then systemd fails to activate wake on lan.
    Output from systemctl status wol@enp0s4 :
    ● [email protected] - Wake-on-LAN for enp0s4
    Loaded: loaded (/etc/systemd/system/[email protected]; enabled)
    Active: inactive (dead) since ven. 2014-07-25 11:21:28 CEST; 23min ago
    Process: 181 ExecStart=/usr/bin/ethtool -s %i wol g (code=exited, status=0/SUCCESS)
    Main PID: 181 (code=exited, status=0/SUCCESS)
    Output from ethtool enp0s4|grep "Wake" :
    Supports Wake-on: pg
    Wake-on: d
    If I explicitly start the service with systemctl start wol@enp0s4, then ethtool enp0s4|grep "Wake" shows:
    Supports Wake-on: pg
    Wake-on: g
    My guess is that the service does not start at the correct timing at boot.
    I have also tried wol-systemd package from the AUR without success.
    Last edited by elb (2014-07-25 15:02:21)

    After a fiew tries and reading docs, I found that replacing network.target with multi-user.target in [email protected] seems to work for me.

  • Power-management: a systemd-aware pm-utils replacement (TLP NIH)

    I'm not a big fan of complicated power management systems like TLP or laptop-mode-tools. IMO, they tend to override too many things at once (like TLP's rfkill state auto-save) and require careful reading and introspection to determine what exactly do you need. Or you may just say that I've got a NIH syndrome.
    As a result, I've been using pm-powersave (part of pm-utils) with custom hooks to manage various kernel tunables. With systemd advent, pm-suspend / pm-hibernate turned useless, and I've felt that it would be good to split pm-powersave into a separate entity and rewrite it to make use of systemd.
    Release early, release often... So here it is, on github and AUR.
    It consists of:
    a bunch of shell-written hooks, ran on battery events via udev rule -> systemd target -> systemd templated unit -> shell-written wrapper
    a bunch of other udev rules, configuring per-device things like PCI runtime power management
    Current hooks include:
    HDD standby timeout and APM via hdparm
    filesystem readahead via blockdev
    cpufreq governor via sysfs interface (works with intel_pstate as well as acpi_cpufreq: tries conservative/ondemand, then falls back to powersave/performance)
    x86 performance bias via cpupower
    journal commit time on ext2/3/4 filesystems via mount -o remount,commit=%d
    module remove/insert (by default, uvcvideo is removed, override this if you use webcam while on battery)
    WLAN power saving via iw dev %s set power_save
    PCI Express ASPM via sysfs interface (make sure to pass pcie_aspm=force to your kernel cmdline if you have a broken ACPI implementation (you probably do))
    SATA ALPM via sysfs interface
    sysctl tunables (by default, vm.laptop_mode and xfs tunables are touched)
    Current udev rules include:
    PCI and USB runtime power management via /sys/bus/{pci,usb}/devices/**/power/control
    USB autosuspend via /sys/bus/usb/devices/**/power/autosuspend, the default timeout is 150 seconds
    Wake-on-LAN via ethtool (for now, WOL is unconditionally disabled, you may want to override this). I'm planning to make this "disable when on battery" at some point.
    The default settings are rather prototypish, so I'm ready for suggestions.
    Last edited by intelfx (2014-06-07 14:17:08)

    mordoc, what exactly is the problem your having?
    Since I made the original post I have actually succeeded in creating the setup I described, i.e. I have removed laptop-mode-tools and have pm-utils do all suspend, hibernate and power management functions using acpid.  This required adding a very simple custom hook to pm-powersave to deal with all the power-saving functions of laptop-mode-tools that pm-powersave does not (yet) replace OOTB.

  • [VPN] [GUIDE] Setting up nordvpn with systemd

    Since I haven't seen specific guide to setting up nordvpn for archlinux with systemd, I thought I should write them up what I have done. This might be useful for those unfamiliar with systemd. Simply connecting with provided *.ovpn file do not update the DNS correctly and the command
    sudo systemctl start [email protected] do not work.
    1. Follow nordvpn's connecting with shell instruction at https://nordvpn.com/tutorials/linux/linux-openvpn/ and make sure you can manually connect by typing:
    sudo openvpn vpn_at_nordvpn_tcp.ovpn
    2. Create unit systemd for a server
    sudo nano /etc/systemd/system/nordvpn.service
    [Unit]
    Description=OpenVPN connection to yourovpn.ovpn
    [Service]
    Type=forking
    ExecStart=/usr/bin/openvpn --cd /etc/openvpn --config /etc/openvpn/yourovpn.ovpn --daemon [email protected] --writepid /run/[email protected]
    PIDFile=/run/[email protected]
    [Install]
    WantedBy=multi-user.target
    replace yourovpn with the desired server.
    For whatever reason, the following modified /usr/lib/systemd/system/[email protected] do not work.
    [Unit]
    Description=OpenVPN connection to %i
    [Service]
    Type=forking
    #ExecStart=/usr/bin/openvpn --cd /etc/openvpn --config /etc/openvpn/%i.conf --daemon openvpn@%i --writepid /run/openvpn@%i.pid
    ExecStart=/usr/bin/openvpn --cd /etc/openvpn --config /etc/openvpn/%i.ovpn --daemon openvpn@%i --writepid /run/openvpn@%i.pid
    PIDFile=/run/openvpn@%i.pid
    [Install]
    WantedBy=multi-user.target
    3. The DNS was not updated. So use the guide from the wiki and add these to your .ovpn file
    # auto update /etc/resolv.conf
    script-security 2
    up /etc/openvpn/update-resolv-conf.sh
    down /etc/openvpn/update-resolv-conf.sh
    the shell script is found at https://raw.githubusercontent.com/maste … lv-conf.sh
    One issue I found is that you do not get that "Initialization Sequence Completed" to indicate a successful vpn connection. I had to either google my public ip address or type:
    ip addr show | grep tun0
    Any feedback or improvisations are appreciated.

    Since I haven't seen specific guide to setting up nordvpn for archlinux with systemd, I thought I should write them up what I have done. This might be useful for those unfamiliar with systemd. Simply connecting with provided *.ovpn file do not update the DNS correctly and the command
    sudo systemctl start [email protected] do not work.
    1. Follow nordvpn's connecting with shell instruction at https://nordvpn.com/tutorials/linux/linux-openvpn/ and make sure you can manually connect by typing:
    sudo openvpn vpn_at_nordvpn_tcp.ovpn
    2. Create unit systemd for a server
    sudo nano /etc/systemd/system/nordvpn.service
    [Unit]
    Description=OpenVPN connection to yourovpn.ovpn
    [Service]
    Type=forking
    ExecStart=/usr/bin/openvpn --cd /etc/openvpn --config /etc/openvpn/yourovpn.ovpn --daemon [email protected] --writepid /run/[email protected]
    PIDFile=/run/[email protected]
    [Install]
    WantedBy=multi-user.target
    replace yourovpn with the desired server.
    For whatever reason, the following modified /usr/lib/systemd/system/[email protected] do not work.
    [Unit]
    Description=OpenVPN connection to %i
    [Service]
    Type=forking
    #ExecStart=/usr/bin/openvpn --cd /etc/openvpn --config /etc/openvpn/%i.conf --daemon openvpn@%i --writepid /run/openvpn@%i.pid
    ExecStart=/usr/bin/openvpn --cd /etc/openvpn --config /etc/openvpn/%i.ovpn --daemon openvpn@%i --writepid /run/openvpn@%i.pid
    PIDFile=/run/openvpn@%i.pid
    [Install]
    WantedBy=multi-user.target
    3. The DNS was not updated. So use the guide from the wiki and add these to your .ovpn file
    # auto update /etc/resolv.conf
    script-security 2
    up /etc/openvpn/update-resolv-conf.sh
    down /etc/openvpn/update-resolv-conf.sh
    the shell script is found at https://raw.githubusercontent.com/maste … lv-conf.sh
    One issue I found is that you do not get that "Initialization Sequence Completed" to indicate a successful vpn connection. I had to either google my public ip address or type:
    ip addr show | grep tun0
    Any feedback or improvisations are appreciated.

  • [Solved] Running mpd as user mpd with systemd without using mpd.conf

    Maybe this is tivial, but I searched about an hour without any results. I want to run mpd as user mpd. I cant use the mpd config file since mpd set the UID and GID explicitely resulting in mpd not having the necessary supplementary groups to access the locally shared music on my pc. Well I tried to run mpd with systemd by
    # systemctl start mpd
    and  the systemd contains the user mpd
    $ cat /etc/systemd/system/default.target.wants/mpd.service
    [Unit]
    Description=Music Player Daemon
    After=network.target sound.target
    [Service]
    User=mpd
    ExecStart=/usr/bin/mpd --no-daemon
    # allow MPD to use real-time priority 50
    LimitRTPRIO=50
    LimitRTTIME=-1
    # move MPD to a top-level cgroup, as real-time budget assignment fails
    # in cgroup /system/mpd.service, because /system has a zero real-time
    # budget; see
    # http://www.freedesktop.org/wiki/Software/systemd/MyServiceCantGetRealtime/
    ControlGroup=cpu:/mpd
    # assign a real-time budget
    ControlGroupAttribute=cpu.rt_runtime_us 500000
    [Install]
    WantedBy=default.target
    but it did not run as mpd.
    Well how can I run mpd as mpd? Is there a way to do it like with dropbox: dropbox@<user>.service
    Last edited by manuelschneid3r (2015-03-25 12:52:52)

    Glad you solved it. Was just typing a response and I'll still add two remarks:
    The ps|grep output showed that you run grep as root, not mpd itself (which won't have a space in the command -- the second time it only worked because the mpd group is preceded by a space).
    It sounds like it took you a while to find the drop-in configuration snippet in the mpd.service.d directory. These drop-in are shown in `systemctl status`, which is something you'd normally check in situations like these, and that might help to discover them more quickly.
    Last edited by Raynman (2015-03-25 12:58:36)

  • How to run a command automaticly on starting up with systemd

    Hi,
    I'm using a laptop with two video card, an ATI 3400 and a intel integrated video card.
    Several months ago, I use rc.local to disable the ATI 3400 with the command below:
    mount -t debugfs debugfs /sys/kernel/debug
    echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
    What should I do to enable these commands with systemd?
    Thank You!

    brain0 wrote:
    yumtaoist wrote:
    nomorewindows wrote:Make a .service file and make sure that systemd calls it.
    I have write a video.service file like below
    [Unit]
    Description=Disable the Discrete Graphics
    Requires=sys-kernel-debug.mount
    After=sys-kernel-debug.mount
    [Service]
    Type=oneshot
    ExecStart=echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
    And the result of "systemctl is-enabled video.service" is static
    However, this just does not work. I'm not familiar with systemd.
    Buy the way, thank you!
    First of all, put this into /etc/systemd/system/. Then add an install section to this unit:
    [Install]
    WantedBy=multi-user.target
    or
    [Install]
    WantedBy=basic.target
    (No idea which one is better). Then run:
    # systemctl daemon-reload
    # systemctl enable video.service
    Last edited by brain0 (2012-10-27 20:09:25)

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

  • Stacking openvpn connections with systemd

    I have many openvpn servers,I am trying to stack multiple openvpn connections one though the other, that is I want tun1 to go through tun0. If I enter the commands in order and wait for the interfaces to come up before proceeding, it works. I switch servers, and order of servers, several times a day. I am trying to get this automated. As i can not risk having any data sent over non tunneled channels, I cannot automate much of my system until this is. My problem is that I pull the routing table from the servers that sends my traffic through the tunnel, if i
    systemctl start openvpn@(Server1Name)
    systemctl start openvpn@(Server2Name)
    this will start the Server2 before Server1 is connected and the tun0 interface is up, resulting in 2 interfaces but each connected directly to the Internet.Reading the man systemd.unit i found the "Before= and After=" but i am unsure of how to use these correctly as I switch servers(and ordering) multiple times a day.I have a script that can randomly select the server the next server for me. What i am really hoping for is a way to have systemd only start the next openvpn tunnel after the previous tun[n] interface is up. that is
    script picks next random server
    start next server
    if tun[n] up then n+=1
    loop until n = current paranoid level
    Why not just put this in a script and run it after startup? Because I need all traffic to go through these tunnels. and not having this at boot means that i cannot have systemd start any network applications(I have a lot). Also but not as important, is it is nice to have the Internet ready to go after boot up.

    You have your own answer
    tsr-nc wrote:Reading the man systemd.unit i found the "Before= and After="
    Yes, that way.
    copy the /usr/lib/systemd/system/[email protected] to /etc/systemd/system, for each connection you have. and don't forget to name them with different name, like /etc/systemd/system/ovpn1.service, /etc/systemd/system/ovpn2.service, etc
    Edit every one of those files, setting both After and Requires putting them in order. and change the %i to be the name of the conf file.
    ...Not sure why you are doing such thing, I don't think that makes it more secure or anything.

  • Brightness control at startup with systemd

    I finally upgraded to systemd (I know... a bit later than I should have), and the transistion has been smooth, except for enabling brightness controll at boot.
    I currently have a bit of a hack working to enable brightness control on my Dell XPS 13 ultrabook. I have two backlight interfaces (/sys/class/backlight/intel_backlight and /sys/class/backlight/acpi_video0), and I have found that the only way to alter my screen brightness is to set the intel_backlight brightness value to 0 and then alter the brightness file under the acpi_video0 interface. I must always write the 0 to the intel_backlight/brightness file, even if it already contains 0, to enable brightness control through acpi_video0.
    I had had this code in my rc.local previously, and it worked exactly as I needed to enable brightness control:
    #!/bin/bash
    # set intel interface to 0, allowing acpi interface to take precedence
    echo 0 > /sys/class/backlight/intel_backlight/brightness
    # set the permissions of the acpi brightness file for video group (me) regular user modification
    chgrp video /sys/class/backlight/acpi_video0/brightness
    chmod 664 /sys/class/backlight/acpi_video0/brightness
    # initialize brightness to a low level
    echo 3 > /sys/class/backlight/acpi_video0/brightness
    exit 0
    Currently when I run this script normally it grants me the brightness control I desire through the modification of /sys/class/backlight/acpi_video0/brightness. I have made this script into a systemd service initiated at startup, with the service file below:
    [Unit]
    Description=Brightness Control Initialization
    [Service]
    Type=oneshot
    ExecStart=/usr/lib/systemd/scripts/bright_init
    RemainAfterExit=yes
    [Install]
    WantedBy=multi-user.target
    My issue is that although the service is initiated at startup without error, my brightness control does not function like it does when I run the script manually myself. I have verified that systemd considers the service to have run successfully after startup, and I have also enabled both the multi-user.target and above service.
    My questions are twofold:
    1. Is there a better way to allow brightness control other than the somewhat hacky method of zeroing the /sys/class/backlight/intel_backlight/brightness file with the above script?
    2. And does anyone have an idea as to why my service doesn't work, even though I can run the script after startup and it functions as I desire?
    Last edited by tyler.heck (2012-11-16 01:45:46)

    It is interesting to see that this is working for you. I had to add OWNER="root" to the rule. Otherwise when testing the rule with `udevadm test` I always recieved a permission denied error. But even with OWNER="root" Udev did not actually write the ATTR{brightness}="2" into the file.
    Manually doing that by echo 2 > ... works well. I searched a bit on this topic and found a thread on the Gentoo forum where they say that it is not wise to use Udev for writing anything to /sys. Instead you should use Udev to run a script that does that:
    [orschiro@thinkpad ~]$ cat /etc/udev/rules.d/50-powersave.rules
    SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="0", RUN+="/home/orschiro/Scripts/powersaving battery"
    SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="1", RUN+="/home/orschiro/Scripts/powersaving AC"
    [orschiro@thinkpad ~]$ cat /usr/local/bin/powersaving
    #!/bin/sh
    case $1 in
    battery)
    echo "Running powersaving on AC in 3 seconds"
    sleep 3
    # screen power saving"
    echo 200000 > /sys/class/backlight/intel_backlight/brightness
    AC)
    echo "Running powersaving on battery in 3 seconds"
    sleep 3
    # screen power saving
    echo 4270725 > /sys/class/backlight/intel_backlight/brightness
    esac
    Last edited by orschiro (2013-03-01 15:29:02)

  • [SOLVED] Problems with systemd-update-utmp after systemd update

    Hi all,
    I noticed that systemd-update-utmp-runlevel.service has been failing since the last systemd update. My systemd is:
    Repository : core
    Name : systemd
    Version : 184-2
    $ systemctl status systemd-update-utmp-runlevel.service
    systemd-update-utmp-runlevel.service - Update UTMP about System Runlevel Changes
    Loaded: loaded (/usr/lib/systemd/system/systemd-update-utmp-runlevel.service; static)
    Active: failed (Result: exit-code) since Sat, 02 Jun 2012 13:55:40 +0200; 56min ago
    Docs: man:utmp(5)
    Main PID: 395 (code=exited, status=1/FAILURE)
    CGroup: name=systemd:/system/systemd-update-utmp-runlevel.service
    The exact cause of error is:
    Jun 02 13:55:40 arch systemd-update-utmp[395]: Failed to write utmp record: No such file or directory
    Jun 02 13:55:40 arch systemd[1]: systemd-update-utmp-runlevel.service: main process exited, code=exited, status=1
    What's more, after this update I am not able to mount vmware hgfs shares. I've got following entry in my /etc/fstab (from arch's wiki)
    #enable shared folders
    .host:/ /mnt/hgfs vmhgfs defaults,ttl=5 0 0
    It worked just fine. After the update system boots into maintenance mode with the following message found in sysemd-journal:
    arch mount[143]: Directory in share name must not be empty
    arch mount[143]: Error: share name is invalid, aborting mount
    After commenting hgfs mount entry out the system boots normally.
    Thanks in advance.
    EDIT:
    Mounting hgfs shares manually works as expected
    $: sudo mount /mnt/hgfs
    Could not add entry to mtab, continuing
    mtab:
    .host:/ /mnt/hgfs vmhgfs rw,relatime 0 0
    so this issue must be systemd related
    Last edited by mrzeznicki (2012-06-07 15:18:05)

    falconindy wrote:Still can't reproduce this. libmount's parser does just fine with ".host" as a dummy entry in my /etc/hosts file mapped for an NFS share.
    Yep, libmount is probably not a problem, I guess this error comes from vmware's hgfsmounter
    static Bool
    ParseShareName(const char *shareName, // IN: Share name to validate
    const char **shareNameHost, // OUT: Share name, host component
    const char **shareNameDir) // OUT: Share name, dir component
    const char *colon, *dir;
    /* 1) Must be colon separated into host and dir. */
    colon = strchr(shareName, ':');
    if (colon == NULL) {
    printf("Share name must be in host:dir format\n");
    return FALSE;
    /* 2) Dir must not be empty. */
    dir = colon + 1;
    if (*dir == '\0') {
    printf("Directory in share name must not be empty\n");
    return FALSE;
    /* 3) Dir must start with forward slash. */
    if (*dir != '/') {
    printf("Directory in share name must be an absolute path\n");
    return FALSE;
    /* 4) Host must be ".host". */
    if (strncmp(shareName, ".host:", 6) != 0) {
    printf("Host in share name must be \".host\"\n");
    return FALSE;
    *shareNameHost = ".host";
    LOG("Host component of share name is \"%s\"\n", *shareNameHost);
    *shareNameDir = dir;
    LOG("Directory component of share name is \"%s\"\n", *shareNameDir);
    return TRUE;
    I am just wondering why it worked before (and why manual mount works). Is there anything in systemd mount layer that consumes '/'?

Maybe you are looking for

  • I recently upgraded from Firefox ESR version 10 to version 17.0.7, and the Serch by Name function no longer works.

    I was using Firefox ESR 10.0.11 and was forced to upgrade to 17.0.7 yesterday, even though my cfg file is set to not allow updates. Since the upgrade, the Search by Name function has stopped working, i.e.: I used to be able to type "yahoo" into the a

  • Status Definition in Project Administration

    Hi@ll i want to know, if you define Status in the PROJECT_ADMIN then this statuses will be available at diffrent locations, e.g. Business Blueprint Documents, Configurations Documents etc. For example, i define 5 status: open, closed, in work, paused

  • Download destination folder not working

    when I have download files I have set forefox to put them on the desktop. Even though I haven't changed that setting it puts them in the temp folder. I have tried to reset it a few times but nothing has changed. If I download podcasts it still goes t

  • Will western digital drive work?????????

          I am going to buy a hard drive (this one). I called up western digital, and they said it would work with all mac computers. But the guy from tech support didn't sound sure. I think i saw baby boomer say that WD drives hardly ever work (i could

  • Bios Disk Creation & Hard Drive Question A22p

    I am trying to create a disk to flash the bios on a A22p thinkpad.  I have followed the directions on the download page but can't get beyond the DOS screen that contains the license info so nothing ever gets copied to my floppy (dispite using a comma