[SOLVED] PPv4: systemd for Monkey

This forum is for Marvell Kirkwood devices such as the GoFlex Home/Net, PogoPlug v1/v2, SheevaPlug, and ZyXEL devices.

[SOLVED] PPv4: systemd for Monkey

Postby winestock » Sat Feb 02, 2013 3:40 pm

I am now fully systemd using linux-kirkwood 3.7.5. I installed Monkey and I tried to enable it using systemctl:
$this->bbcode_second_pass_code('', '
sudo systemctl enable monkey
Failed to issue method call: No such file or directory
')

What do I need to get Monkey running under systemd or is the only way right now to install initscripts?
Last edited by winestock on Sat Feb 02, 2013 4:46 pm, edited 1 time in total.
Pogoplug Series 4 / Linux-Kirkwood 3.10.10-2
winestock
 
Posts: 134
Joined: Mon Nov 05, 2012 12:03 am

Re: PPv4: systemd for Monkey

Postby winestock » Sat Feb 02, 2013 4:45 pm

I did find a work around for this. I create /lib/systemd/system/monkey.service:
$this->bbcode_second_pass_code('', '
[Unit]
Description=Monkey HTTP Daemon
Requires=network.target
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/monkey
PIDFile=/var/run/monkey.pid
Restart=always

[Install]
WantedBy=multi-user.target
')

To enable monkey:
$this->bbcode_second_pass_code('', '
ln -s /usr/lib/systemd/system/monkey.service /etc/systemd/system/multi-user.target.wants/monkey.service
')

I then was able to "systemctl start monkey". I give credit to this work around to: http://bugs.monkey-project.com/ticket/60.
Pogoplug Series 4 / Linux-Kirkwood 3.10.10-2
winestock
 
Posts: 134
Joined: Mon Nov 05, 2012 12:03 am

Re: [SOLVED] PPv4: systemd for Monkey

Postby winestock » Fri Feb 08, 2013 3:55 pm

It seems that there was already a Arch Linux systemd Wiki page for Monkey: https://wiki.archlinux.org/index.php/Systemd/Services

In there it shows for monkey:
$this->bbcode_second_pass_code('', '
/etc/systemd/system/monkey.service[Unit]
Description=Monkey http server deamon
After=network.target

[Service]
Type=forking
ExecStart=/YOUR/PATH/TO/monkey/bin/monkey -D
ExecStop=/bin/kill $MAINPID
ExecReload=/bin/kill $MAINPID ; /YOUR/PATH/TO/monkey/bin/monkey -D
PIDFile=/YOUR/PATH/TO/monkey/monkey.pid.80

[Install]
WantedBy=multi-user.target
')

When I try:
$this->bbcode_second_pass_code('', '
systemctl start monkey
')

systemctl hangs until I press CTRL-C.
Pogoplug Series 4 / Linux-Kirkwood 3.10.10-2
winestock
 
Posts: 134
Joined: Mon Nov 05, 2012 12:03 am

Re: [SOLVED] PPv4: systemd for Monkey

Postby moonman » Fri Feb 08, 2013 6:03 pm

You did change "/YOUR/PATH/TO/monkey" to "/usr" right?

Your service file should be this (according the first one you posted)

$this->bbcode_second_pass_code('', '[Unit]
Description=Monkey http server deamon
After=network.target

[Service]
Type=forking
ExecStart=/usr/bin/monkey -D
ExecStop=/bin/kill $MAINPID
ExecReload=/bin/kill $MAINPID ; /usr/bin/monkey -D
PIDFile=/var/run/monkey.pid.80

[Install]
WantedBy=multi-user.target')
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: [SOLVED] PPv4: systemd for Monkey

Postby winestock » Fri Feb 08, 2013 9:48 pm

$this->bbcode_second_pass_quote('moonman', 'Y')ou did change "/YOUR/PATH/TO/monkey" to "/usr" right?

Your service file should be this (according the first one you posted)

$this->bbcode_second_pass_code('', '[Unit]
Description=Monkey http server deamon
After=network.target

[Service]
Type=forking
ExecStart=/usr/bin/monkey -D
ExecStop=/bin/kill $MAINPID
ExecReload=/bin/kill $MAINPID ; /usr/bin/monkey -D
PIDFile=/var/run/monkey.pid.80

[Install]
WantedBy=multi-user.target')


I posted that wrong. Yes, I replaced "/YOUR/PATH/TO/" with "/usr/bin/". I was just showing what the Wiki had in it. The Wiki is incorrect for the monkey.service. And I don't mean about the "/YOUR/PATH/TO/" part. The monkey.service In my first post in this thread is what the Wiki should reflect.
Pogoplug Series 4 / Linux-Kirkwood 3.10.10-2
winestock
 
Posts: 134
Joined: Mon Nov 05, 2012 12:03 am

Re: [SOLVED] PPv4: systemd for Monkey

Postby moonman » Fri Feb 08, 2013 10:55 pm

wiki is right, the config file is not. I've fixed the package and added service file. Should be available soon in the repo (if it isnt already)
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: [SOLVED] PPv4: systemd for Monkey

Postby winestock » Fri Feb 08, 2013 11:55 pm

$this->bbcode_second_pass_quote('moonman', 'w')iki is right, the config file is not. I've fixed the package and added service file. Should be available soon in the repo (if it isnt already)


Is this the service file you put in the package for monkey:
$this->bbcode_second_pass_code('', '
[Unit]
Description=Monkey http server deamon
After=network.target

[Service]
Type=forking
ExecStart=/usr/bin/monkey -D
ExecStop=/bin/kill $MAINPID
ExecReload=/bin/kill $MAINPID ; /usr/bin/monkey -D
PIDFile=/var/run/monkey.pid.80

[Install]
WantedBy=multi-user.target
')

That is the one I tried and had the issue where I attempted "systemctl start monkey" and systemctl did not come back until I hit CTRL-C. This is the service that works:

$this->bbcode_second_pass_code('', '
[Unit]
Description=Monkey HTTP Daemon
Requires=network.target
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/monkey
PIDFile=/var/run/monkey.pid
Restart=always

[Install]
WantedBy=multi-user.target

')
Pogoplug Series 4 / Linux-Kirkwood 3.10.10-2
winestock
 
Posts: 134
Joined: Mon Nov 05, 2012 12:03 am

Re: [SOLVED] PPv4: systemd for Monkey

Postby moonman » Sat Feb 09, 2013 12:26 am

The one that didnt work for you. the reason why it didnt work is because it was putting pid file in a different dir than specified in the service file. Also it appends port number to the pid file name. Service file assumes port 80, config file had port 2001. Anyway, it works now.

https://github.com/archlinuxarm/PKGBUIL ... 613a41c54b
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: [SOLVED] PPv4: systemd for Monkey

Postby winestock » Sat Feb 09, 2013 12:59 am

$this->bbcode_second_pass_quote('moonman', 'T')he one that didnt work for you. the reason why it didnt work is because it was putting pid file in a different dir than specified in the service file. Also it appends port number to the pid file name. Service file assumes port 80, config file had port 2001. Anyway, it works now.

https://github.com/archlinuxarm/PKGBUIL ... 613a41c54b


I see what you did. Thanks. By the way, there is going to be an update to Monkey to version 1.2. When that is released will it get picked up autonatically so that pacman can do the update.
Pogoplug Series 4 / Linux-Kirkwood 3.10.10-2
winestock
 
Posts: 134
Joined: Mon Nov 05, 2012 12:03 am
Top

Re: [SOLVED] PPv4: systemd for Monkey

Postby winestock » Sat Feb 09, 2013 1:25 am

Okay I copied monkey.service directly from what you checked into https://github.com/archlinuxarm/PKGBUIL ... 613a41c54b:

/lib/systemd/system/monkey.service
$this->bbcode_second_pass_code('', '
[Unit]
Description=Monkey http server deamon
After=network.target

[Service]
Type=forking
ExecStart=/usr/bin/monkey -D
ExecStop=/bin/kill $MAINPID
ExecReload=/bin/kill $MAINPID ; /usr/bin/monkey -D
PIDFile=/var/run/monkey/monkey.pid.80

[Install]
WantedBy=multi-user.target
')

$this->bbcode_second_pass_code('', '
systemctl --system daemon-reload
systemctl start monkey
')

At this point systemctl does not come back. I have to CTRL-C to get back to the shell prompt. Does not look like it is working.
Pogoplug Series 4 / Linux-Kirkwood 3.10.10-2
winestock
 
Posts: 134
Joined: Mon Nov 05, 2012 12:03 am

Next

Return to Marvell Kirkwood

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 11 guests