Autorun / Automount / Autostart xzm [Solved]

Post here if you are a new Porteus member and you're looking for some help.
nassausky
Black ninja
Black ninja
Posts: 35
Joined: 14 Feb 2013, 18:32
Distribution: Porteus v2.0 rc2 i486
Location: NY

Autorun / Automount / Autostart xzm [Solved]

Post#1 by nassausky » 14 Feb 2013, 18:40

Hi Everyone,

I found a great package called tigervnc and wanted to remaster a cd with it installed. I am having a problem with having it automatically startup across reboots. These are the steps I did so far.

1) I installed porteus v2.0 rc2 i486 to the hard drive
2) Went into Settings/Session and Startup and added an autostart application /usr/bin/vncserver

I noticed after a reboot that the xzm modules never reactivated.
-Do I need to add it to some script file
-Which script file and what exactly would I add to it? Does this script file need an administrator password?

What am I doing wrong?

Thanks for any and all help.
Last edited by nassausky on 16 Feb 2013, 16:21, edited 2 times in total.

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Autorun / Automount / Autostart xzm

Post#2 by Hamza » 14 Feb 2013, 18:52

Welcome on board!

Put your xzm module in /porteus/modules folder for automatic activation at each boot. You can also put the command '/usr/bin/vncserver' in the file /etc/rc.d/rc.local which will be executed at each startup.


Cheers!
NjVFQzY2Rg==

nassausky
Black ninja
Black ninja
Posts: 35
Joined: 14 Feb 2013, 18:32
Distribution: Porteus v2.0 rc2 i486
Location: NY

Re: Autorun / Automount / Autostart xzm

Post#3 by nassausky » 14 Feb 2013, 19:09

That was a nice and fast reply!

There is no folder called porteus in the root of the hard drive. Do I just create a new folder called porteus and create a new subfolder inside it called modules and put them there?

Thanks :)

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Autorun / Automount / Autostart xzm

Post#4 by Hamza » 14 Feb 2013, 19:10

No, where is located your porteus data?
NjVFQzY2Rg==

nassausky
Black ninja
Black ninja
Posts: 35
Joined: 14 Feb 2013, 18:32
Distribution: Porteus v2.0 rc2 i486
Location: NY

Re: Autorun / Automount / Autostart xzm

Post#5 by nassausky » 14 Feb 2013, 19:20

The first time I ran Porteus Package Manager it asked for where I would like the modules and I put them in /tmp/md

Funny you asked because the first run of Porteus Package Manager it asked where to store the modules outside the union file system. So I chose a subfolder I created in /tmp and it gave an error saying 'This folder is either on the union file system or was found to be unwritable." So I scratched my head and said this can't be true. So I just selected the same location again and it worked. I was wondering if this was a bug because I did this many times and it always doesn't work the first time.

So I tried making a folder /porteus/modules and putting the .xzm modules inside there and I rebooted and they didn't startup.

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Autorun / Automount / Autostart xzm

Post#6 by Hamza » 14 Feb 2013, 19:24

Please post Porteus Package Manager bugs in the relevant topic.

Please post the output of this command:

Code: Select all

grep -A1 'data' /mnt/live/var/log/livedbg
NjVFQzY2Rg==

nassausky
Black ninja
Black ninja
Posts: 35
Joined: 14 Feb 2013, 18:32
Distribution: Porteus v2.0 rc2 i486
Location: NY

Re: Autorun / Automount / Autostart xzm

Post#7 by nassausky » 14 Feb 2013, 19:33

Aha great.

#Porteus data found in:
/mnt/sda1/porteus

and inside that I see the modules folder so I don't put it inside /porteus/modules but I put the .xzm files inside /mnt/sda1/porteus/modules I assume.


Yay Thanks if it works, where on this forum do I click problem solved :pardon:

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Autorun / Automount / Autostart xzm

Post#8 by Hamza » 14 Feb 2013, 19:35

Yes that's it. If that worked, please add at begin of your intial topic title, the string "[Solved]".

Thanks
NjVFQzY2Rg==

nassausky
Black ninja
Black ninja
Posts: 35
Joined: 14 Feb 2013, 18:32
Distribution: Porteus v2.0 rc2 i486
Location: NY

Re: Autorun / Automount / Autostart xzm

Post#9 by nassausky » 14 Feb 2013, 19:49

Ok great almost there. It's probably so simple I guess they are loaded because I see the files in the correct locations. For example vncserver is now automatically placed into /usr/bin but

-What is the command to see what .xzm files were mounted
-Why didn't /usr/bin/vncserver automatically start up even though I added it to Session and Startup Application Autostart? I can
"put the command '/usr/bin/vncserver' in the file /etc/rc.d/rc.local which will be executed at each startup."
but doesn't that defeat the purpose of having the Session and Startup Application Autostart gui?

Am I thinking of the concept wrong or is it a bug which I have to submit to Package Manager bugs.

Thanks

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Autorun / Automount / Autostart xzm

Post#10 by Hamza » 14 Feb 2013, 19:54

The Porteus Package Manager doesn't manage autoboot programs. It's goal is to help users to install software in security with highly trusted sources and a dependency resolution.

I had never used the GUI to add autostart program. I would suggest you to add the /path/to/binary into the rc.local script as advised before.

The final script should looks like this.

Code: Select all

#!/bin/sh
#
# /etc/rc.d/rc.local:  Local system initialization script.
#
# Put any local startup commands in here.  Also, if you have
# anything that needs to be run at shutdown time you can
# make an /etc/rc.d/rc.local_shutdown script and put those
# commands in there.

/usr/bin/vncserver &
I have added the '&' to run the software in background.
NjVFQzY2Rg==

nassausky
Black ninja
Black ninja
Posts: 35
Joined: 14 Feb 2013, 18:32
Distribution: Porteus v2.0 rc2 i486
Location: NY

Re: Autorun / Automount / Autostart xzm

Post#11 by nassausky » 14 Feb 2013, 20:10

That made sense and thanks for being very clear. I haven't used the & symbol to run a background process in quite some time and it's good for the refreshment.

I tried adding it to the rc.local file as suggested inside the /etc/rc.d folder and the process didn't startup after reboot. I definitely thought it would startup with your advice.

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Autorun / Automount / Autostart xzm

Post#12 by Hamza » 14 Feb 2013, 20:15

Please try to start your vncserver software in a running terminal. It looks like there is a problem. Please post the content of error if there is one when you're attempting to run it from a running terminal.
NjVFQzY2Rg==

nassausky
Black ninja
Black ninja
Posts: 35
Joined: 14 Feb 2013, 18:32
Distribution: Porteus v2.0 rc2 i486
Location: NY

Re: Autorun / Automount / Autostart xzm

Post#13 by nassausky » 14 Feb 2013, 20:22

Yes I ran vncserver in a terminal and it asked for a password for the remote user to connect. I think this is the problem. I noticed it asked for a password during reboot and just pressed 'enter' not thinking it was the vnc password that it required. I am playing with it right now trying to have it save a password. Maybe add it to the rc.local file or something. Let me know if you think this could be a new topic because I got the xzm to load and know how to autostart items by putting them in the rc.local file.


Thanks

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Autorun / Automount / Autostart xzm

Post#14 by Hamza » 14 Feb 2013, 20:26

No you can stay on this topic. That explains everything, it starts but it stopped when you pressed Enter to skip without thinking that was vncserver. Please try this time to enter the correct password and let me know if that worked.
NjVFQzY2Rg==

nassausky
Black ninja
Black ninja
Posts: 35
Joined: 14 Feb 2013, 18:32
Distribution: Porteus v2.0 rc2 i486
Location: NY

Re: Autorun / Automount / Autostart xzm [Solved]

Post#15 by nassausky » 14 Feb 2013, 21:13

Ok it's not as straightforward as maybe other daemons running at startup. Using the & (background) flag didn't seem to start the vncserver. I disabled the & flag and it asked for a password at bootup (this password is the password the vncserver uses to authenticate clients) I ran a vncserver --help and to look on how to save the password and it supposedly is as simple as running vncpasswd which might modify a file which it saves it to. Then any following request for vncserver to start, it will use that password.

Here is where I am at. If I run /usr/bin/vncserver in the rc.local with or without the & (background flag) it starts up in the background and I don't see it running with the command:
ps aux | grep vncserver

but the command:
vncserver -list
displays:
X DISPLAY # PROCESS ID
:3 1749

OK good but then I asked why it wasn't display :1 so I can remotely hook into port 5901. For some reason i can't set the exact port but it isn't critical for now. Anyone who is an expert at vnc will tell me to use an ssh tunnel but that will come soon. This is a private network anyway.

So to sum it all up it functions but needs some work.

Thanks!

Post Reply