On Thu, Feb 21, 2013 at 7:10 AM, Khem Raj <raj.k...@gmail.com> wrote:

> On Wed, Feb 20, 2013 at 10:14 AM, Wayne Tams <wayne.t...@gmail.com> wrote:
> > Hi,
> >
> > I am making some modifications to Angstrom and I need to add a new timer
> to
> > systemd. Now my timer works fine when I start it manually using systemctl
> > but I just can't figure out how to get it to start auto-magically when
> > systemd brings all the other services online? Is the behaviour I am
> > expecting not what systemd timer units provide?
> >
> > I have created some other standard services which initialise normally.
> >
> > I am now considering just adding the "systemctl start myservice.timer" to
> > another startup script to drag it into existence.
> >
> > Here is my bb if that is of any help.
> >
> > All the best
> >
> > Wayne
> >
> > //-----------------------
> >
> > inherit allarch systemd
> >
> > SRC_URI = " \
> > file://myservice.service \
> > file://myservice.timer \
> > "
> >
> > do_install () {
> > install -d ${D}/${base_libdir}/systemd/system
> >
> > install -m 0644 ${WORKDIR}/myservice.service
> > ${D}/${base_libdir}/systemd/system/
> >  install -m 0644 ${WORKDIR}/myservice.timer
> > ${D}/${base_libdir}/systemd/system/
> > }
> >
>
> Whats your target arch ?
>
> you do not need the above do install step if you are using meta-systemd
> but using ${base_libdir} to install unit files is wrong. You should use
> ${D}${systemd_unitdir}/system instead.
>
> it would also help if you could show the unitfile contents too
>
>
> > NATIVE_SYSTEMD_SUPPORT = "1"
> > SYSTEMD_PACKAGES = "${PN}"
> > SYSTEMD_SERVICE_${PN} = "myservice.timer"
> >
> > FILES_${PN} += "${base_libdir}/systemd"
> >
> > //----------------------------
> > _______________________________________________
> > Angstrom-distro-devel mailing list
> > Angstrom-distro-devel@linuxtogo.org
> >
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/angstrom-distro-devel
>
> _______________________________________________
> Angstrom-distro-devel mailing list
> Angstrom-distro-devel@linuxtogo.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/angstrom-distro-devel


I'm building for ARM using the default configuration of the Angstrom
distribution (2012.05) configured using the Angstrom setup scripts. I'm not
using meta-systemd.

I've managed to get the timer firing, what seems to have helped is adding
Wantedby to the timers unit file.

[Unit]
Description=A Periodic check

[Timer]
RemainAfterExit=Yes
OnStartupSec=10s
OnUnitActiveSec=60s

[Install]
WantedBy=basic.target

I appreciate you pointing out my error in the bb file, I will change
${base_libdir} to ${systemd_unitdir}.

Wayne
_______________________________________________
Angstrom-distro-devel mailing list
Angstrom-distro-devel@linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/angstrom-distro-devel

Reply via email to