How to setup amuled to start at boot?

Asked by ZioNemo

Hi, I have a headless server where I would like to have amule running in background.
I can start amule from a local user.
I did edit /etc/default/amule-daemon setting:

AMULED_USER="xxyy"
AMULED_HOME="/srv/Downloads/aMule"

xxyy@server:~$ ls -la /srv/Downloads/aMule
total 92
drwxr-xr-x 4 xxyy xxyy 4096 2009-11-09 12:11 .
drwxr-xr-x 4 root root 4096 2009-11-06 22:22 ..
lrwxrwxrwx 1 xxyy xxyy 1 2009-11-06 22:25 .aMule -> .
-rw-r--r-- 1 xxyy xxyy 2995 2009-11-09 12:11 amule.conf
-rw-r--r-- 1 xxyy xxyy 5 2009-11-09 12:11 clients.met
-rw-r--r-- 1 xxyy xxyy 5 2009-11-09 12:11 clients.met.BAK
-rw-r--r-- 1 xxyy xxyy 365 2009-11-06 22:26 cryptkey.dat
-rw-r--r-- 1 xxyy xxyy 5 2009-11-09 12:11 emfriends.met
drwxr-xr-x 2 xxyy xxyy 4096 2009-11-06 22:26 Incoming
-rw-r--r-- 1 xxyy xxyy 182 2009-11-06 22:26 ipfilter.dat
-rw-r--r-- 1 xxyy xxyy 298 2009-11-06 22:26 ipfilter_static.dat
-rw-r--r-- 1 xxyy xxyy 28 2009-11-09 12:11 key_index.dat
-rw-r--r-- 1 xxyy xxyy 1 2009-11-06 22:26 known2_64.met
-rw-r--r-- 1 xxyy xxyy 5 2009-11-09 12:11 known.met
-rw-r--r-- 1 xxyy xxyy 6 2009-11-09 12:11 lastversion
-rw-r--r-- 1 xxyy xxyy 0 2009-11-09 12:11 last_version_check
-rw-r--r-- 1 xxyy xxyy 12 2009-11-09 12:11 load_index.dat
-rw-r--r-- 1 xxyy xxyy 1422 2009-11-09 12:11 logfile
-rw-r--r-- 1 xxyy xxyy 1329 2009-11-09 12:11 logfile.bak
-rw-r--r-- 1 xxyy xxyy 17 2009-11-09 12:11 preferences.dat
-rw-r--r-- 1 xxyy xxyy 23 2009-11-09 12:11 preferencesKad.dat
-rw-r--r-- 1 xxyy xxyy 5 2009-11-09 12:11 server.met
-rw-r--r-- 1 xxyy xxyy 5 2009-11-08 12:19 server_met.old
-rw-r--r-- 1 xxyy xxyy 0 2009-11-09 12:11 shareddir.dat
-rw-r--r-- 1 xxyy xxyy 12 2009-11-09 12:11 src_index.dat
drwxr-xr-x 2 xxyy xxyy 4096 2009-11-06 22:26 Temp
xxyy@server:~$

When I start "sudo /etc/init.d/amule-daemon start" I see no amule in ps:

xxyy@server:~$ ps ax | grep amule
30227 pts/0 S+ 0:00 grep amule

Needless to say neither amuleweb nor amulegui work :)

As said user xxyy can start "normal" amule without any problem.

If it matters:
Linux server 2.6.28-16-generic #56-Ubuntu SMP Mon Nov 2 10:43:06 UTC 2009 i686 GNU/Linux
This is an atom-330 + 4GbRam with an up-to-date ububtu Jaunty.
amule is: "aMule 2.2.4".

What should I check?

TiA
ZioNemo

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu amule Edit question
Assignee:
No assignee Edit question
Solved by:
ZioNemo
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Can amule run in an X-less environment?

Revision history for this message
ZioNemo (zionemo) said :
#2

The "server" is actually a desktop machine *with* X11 installed.
I just wanted to run only one aMule instance and control it from everywhere.

Anyways You are right:

/etc/rc5.d
...
S20amule-daemon
...
S30gdm
...

When amule-daemon is started there is no X active (yet).
I assume this is Ok (I didn't mess with those settings!) and amule-daemon can actually run headless.
If it is not so then ithis is a bug.

Should I file it in bugzilla?

Regards
ZioNemo

Revision history for this message
ZioNemo (zionemo) said :
#3

Amuled will not start without password for external connection.

Revision history for this message
LaM (l.a.m.) said :
#4

Hello, same problem here =)
I'm able to start amule-daemon from console once i've logged on, but it do not start boot time.

Any ideas?

ZioNemo u said it will not start without pass....what u mean? o.0

Thx in advance

Revision history for this message
Vikram Dhillon (dhillon-v10) said :
#5

On Mon, Jan 4, 2010 at 5:44 PM, LaM <email address hidden> wrote:
> Question #89324 on amule in ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/amule/+question/89324
>
> LaM posted a new comment:
> Hello, same problem here =)
> I'm able to start amule-daemon from console once i've logged on, but it do not start boot time.
>
> Any ideas?
>
> ZioNemo u said it will not start without pass....what u mean? o.0
>
> Thx in advance
>
> --
> You received this question notification because you are an answer
> contact for Ubuntu.
>

He means you need sudo/administrative rights to start the program. You
can't start such programs at the boot time, this is build for your own
safety :D

--
Regards,
Vikram Dhillon

~~~
There are lots of Linux users who don't care how the kernel works, but
only want to use it. That is a tribute to how good Linux is.
-- Linus Torvalds

Revision history for this message
LaM (l.a.m.) said :
#6

Amule need administrative rights to run? o.0

Ok sounds pretty weird :)

Anyone know how to bypass it? There must be a way....otherwise would have been pretty stupid to have created a daemon which is just an headless program...no?

Revision history for this message
Vikram Dhillon (dhillon-v10) said :
#7

On Tue, Jan 5, 2010 at 7:19 AM, LaM <email address hidden> wrote:
> Question #89324 on amule in ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/amule/+question/89324
>
> LaM posted a new comment:
> Amule need administrative rights to run? o.0
>
> Ok sounds pretty weird :)
>
> Anyone know how to bypass it? There must be a way....otherwise would
> have been pretty stupid to have created a daemon which is just an
> headless program...no?
>
> --
> You received this question notification because you are an answer
> contact for Ubuntu.
>

Try this out: sudo /etc/init.d/amule-daemon start
and aMule is running as a service. That might help :)

--
Regards,
Vikram Dhillon

~~~
There are lots of Linux users who don't care how the kernel works, but
only want to use it. That is a tribute to how good Linux is.
-- Linus Torvalds

Revision history for this message
LaM (l.a.m.) said :
#8

Eheh...I'm already using that, thou only after logon...what I was tryin to avoid was the logon...

I thought that all the deamon, run at (machine)start up(boot time) was run by the root automatically...

The thing I have not figure out yet is...why if I sudo the daemon on logon it works and not at boot time?

Thx btw for the attention :)

L

Revision history for this message
Vikram Dhillon (dhillon-v10) said :
#9

On Wed, Jan 6, 2010 at 7:32 AM, LaM <email address hidden> wrote:
> Question #89324 on amule in ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/amule/+question/89324
>
> LaM posted a new comment:
> Eheh...I'm already using that, thou only after logon...what I was tryin
> to avoid was the logon...
>
> I thought that all the deamon, run at (machine)start up(boot time) was
> run by the root automatically...
>
> The thing I have not figure out yet is...why if I sudo the daemon on
> logon it works and not at boot time?
>

I think that's a design decision, if a vulnerability comes up while
booting we don't want to give it root previledges so it can do even
more damage.

> Thx btw for the attention :)
>
> L
>
> --
> You received this question notification because you are an answer
> contact for Ubuntu.
>

--
Regards,
Vikram Dhillon

~~~
There are lots of Linux users who don't care how the kernel works, but
only want to use it. That is a tribute to how good Linux is.
-- Linus Torvalds

Revision history for this message
LaM (l.a.m.) said :
#10

I know and You're perfectly right...

ok, noobish question(sorry i've switched to linux since less than a year so...v.v)
what if I change permisions to the daemon inside the init.d to oblige it to run with tha permissions? I think that nothing should change because everything inside there is *run* from root?

I'm I wrong?

Thx for the attention :)

Revision history for this message
LaM (l.a.m.) said :
#11

Ah damn sorry!

I've misread the first time ZioNemo's comment(Amuled will not start without password for external connection.)
The problem is the connection! ok...now I see...

mmmh...so...auto logon + daemon start + machine lock....to bypass it..v.v (bleah)

Thx the same!

Revision history for this message
LaM (l.a.m.) said :
#12

Ok, I got it working...strangely! o.0

I had one prob yesterday night(aka i'm a complete idiot and i've chmoded the whole disk to root...one flag can ruin u to the bone XD ) and I had to make the server back from scratch.

So what I did?

A. Saved from synaptic the list of installed package.
B. reinstalled the sys
B1. configured as I needed
C. Amule part: run the normal prog(amule). Configure it. I've Configured /etc/defaults/samba-daemon to use my sudoer user and i've put a specific folder under home(called .amule) which owner is the sudoer user. (optional: configure the amulegui on the remote machine and/or on the same machine)

Checkin' the ps I see amuled and amuleweb running...in fact I can connect but...I can't see anything inside...I don't understand...

It's working...with issues...i'll do further check and keep u informed :)

see ya

Revision history for this message
LaM (l.a.m.) said :
#13

ahahah...ok found...omg... [BUT...DO NOT TRY THIS AT HOME!!] - warned u...

D. Tricky part. If U wish to configure it U should run amule, then copy the whole configuration(*AFTER KILLING THE DAEMON/PROG* - important) to the daemon config folder mentioned above.

E. Now's ready and fully working.

so, recap:

let's say:
user: AmuleUser (can sudo)
config_folder: /home/.amule (or without . if u wish)

- Create sudo user AmuleUser
- create folder /home/.amule with AmuleUser:groupUwish rw permissions (0770)

- gedit /etc/defaults/samba-daemon:

[code]
   AMULED_USER="AmuleUser"

   bla bla bla [...]

   AMULED_HOME="/home/.amule"
[/code]

- Open amule and configure it to the bone XD

- sudo cp /home/yourUser/.amule /home/.amule

- Check that no mulelock file is in /home/.amule/.amule!!!

Fine. Done! =)

OK...WHY NOT TRY THIS AT HOME:

as soon as I rebooted I cheked with amulegui from the other pc...every part file was there and every shared file was there, as the server list...thou I now am not able to join the server machine(the one amule's running) via xephyr and I'm not able to log the amule user via login on the server!
Look's like it "locks" out quite everything(fortunately i'm still able to log as another non-sudo and sudo users).

I'll report to amule programmers this bizarre behavior....can anyone test what i wrote plz, so I can be sure it's not an issue which occurs only to me?