running pagekite as daemon on embedded linux (no debian or rpm package manager available)

459 views
Skip to first unread message

Aditya Rawat

unread,
Mar 10, 2013, 3:36:18 AM3/10/13
to pagekite...@googlegroups.com
So Pagekite could be used as daemon when installed from debian or rpm package manager however is it possible to turn pagekite.py into a daemon when used on an embedded linux where no package manager is available and therefore no out of the box daemon functionality :( .

Best Wishes
-Adi

Aditya Rawat

unread,
Mar 10, 2013, 3:38:58 AM3/10/13
to pagekite...@googlegroups.com
*** one thing to add trying to run as a startup service in daemon mode

Frédéric Gobry

unread,
Mar 10, 2013, 10:01:05 AM3/10/13
to pagekite...@googlegroups.com
What's on your embedded linux? does it have init scripts (in /etc/init.d for instance)? Depending on what's available on your platform you might get away with borrowing an init script from an existing package, as these are just shell scripts, or you might need to write a custom one. Could be as simple as starting "pagekite --daemonize --pidfile /var/run/pagekite.pid".

Bjarni Rúnar Einarsson

unread,
Mar 10, 2013, 10:14:40 AM3/10/13
to pagekite...@googlegroups.com
You can also take the init scripts and configuration files from the
.rpm or .deb package and manually install them on your system. You
can find them by browsing the github repository at
https://github.com/pagekite/PyPagekite

As you mentioned embedded, if you happen to be working on OpenWRT,
there are also some experimental packages for that platform, as
described here: http://patchwork.openwrt.org/patch/3110/
> --
> You received this message because you are subscribed to the Google Groups
> "pagekite-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pagekite-discu...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
Bjarni R. Einarsson
Founder, lead developer of PageKite.

Make localhost servers visible to the world: https://pagekite.net/

Aditya Rawat

unread,
Mar 10, 2013, 3:40:21 PM3/10/13
to pagekite...@googlegroups.com
Yes the embedded environment has init.d (thankfully)-- its build using BuildRoot .

Okay so I went ahead and copied all the files in https://github.com/pagekite/PyPagekite/tree/main/etc to the rootfs of the embedded linux
and renamed the /etc/init.d/pagekite.debian to /etc/init.d/pagekite
so also /etc/logrotate.d/pagekite.debian to /etc/logrotate.d/pagekite

however still nothing starting up on boot, I am obviously missing something here :p

Frédéric Gobry

unread,
Mar 11, 2013, 4:34:09 AM3/11/13
to pagekite...@googlegroups.com
2013/3/10 Aditya Rawat <adi...@eddywebs.com>
Yes the embedded environment has init.d (thankfully)-- its build using BuildRoot .

Okay so I went ahead and copied all the files in https://github.com/pagekite/PyPagekite/tree/main/etc to the rootfs of the embedded linux
and renamed the /etc/init.d/pagekite.debian to /etc/init.d/pagekite
so also /etc/logrotate.d/pagekite.debian to /etc/logrotate.d/pagekite

however still nothing starting up on boot, I am obviously missing something here :p

I don't know how much you know about shell scripting. One approach would be first to check if the script itself works. Once booted, become root and run the following command:

/etc/init.d/pagekite start

...and check what it complains about. You need to provide a pagekite config besides the script, so if it's missing you'll know for sure.

Once you can manually run start and stop with your script, you can check whether it does so automatically at boot. There, it depends on the mechanism your embedded platform uses. Legacy systems used to use symbolic links from directories (in /etc/rc[0-5].d and you'd find the default "runlevel" in /etc/inittab. Nowadays (yeah, my beard if I had one would be getting greyish :)), more fancy systems use dependency-based starting mechanisms (systemd, upstart,...)

http://en.wikipedia.org/wiki/Runlevel might be an introduction to runlevels if what I said puzzled you. 



--
Frédéric
Reply all
Reply to author
Forward
0 new messages