/etc/init.d/script not working at boot
-
- White ninja
- Posts: 13
- Joined: 20 Mar 2017, 14:41
- Distribution: Porteus Desktop
- Location: Czech Rep.
/etc/init.d/script not working at boot
Hi,
I have XZM module for starting dropbear ssh server. It work flawlessly, when activated from running mate, but is seems not to be run when placed in /porteus/modules.
Any idea?
Thanks, Michal
I have XZM module for starting dropbear ssh server. It work flawlessly, when activated from running mate, but is seems not to be run when placed in /porteus/modules.
Any idea?
Thanks, Michal
-
- White ninja
- Posts: 13
- Joined: 20 Mar 2017, 14:41
- Distribution: Porteus Desktop
- Location: Czech Rep.
Re: /etc/init.d/script not working at boot
Hm,
moving script to /etc/rc.d did not help.
When added line
/etc/rc.d/dropbear start
into /etc/rc.d/rc.local, the scipt is run at boot and works, but I do not like this solution. I would prefer not having to edit system scripts, it all should be done in the XZM module. Where am I to put the module, or what should be in the module for script to be run at boot?
Thanks, Michal
moving script to /etc/rc.d did not help.
When added line
/etc/rc.d/dropbear start
into /etc/rc.d/rc.local, the scipt is run at boot and works, but I do not like this solution. I would prefer not having to edit system scripts, it all should be done in the XZM module. Where am I to put the module, or what should be in the module for script to be run at boot?
Thanks, Michal
- francois
- Contributor
- Posts: 6435
- Joined: 28 Dec 2010, 14:25
- Distribution: xfce plank porteus nemesis
- Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.
Re: /etc/init.d/script not working at boot
From what you write:
- put module into /porteus/modules folder
- make a module to start your script which will contain the start command to rc.d or include in your module the instructions to start rc.d.
Create /tmp/build-module folder and work from there. To understand the structure of a module:
add to the structure of dropbear-ssh.xzm /etc/rc.d/dropbear-ssh-script
dropbear-ssh being a script in which ther will be your only command:
Then repack the directory into a module:
or simply make a simple and tiny module for starting dropbear-ssh as dropbear-start-rc.d in the same way.
- put module into /porteus/modules folder
- make a module to start your script which will contain the start command to rc.d or include in your module the instructions to start rc.d.
Create /tmp/build-module folder and work from there. To understand the structure of a module:
Code: Select all
cd /tmp/build-module
mkdir dropbear-ssh.xzm
xzm2dir dropbear-ssh.xzm dropbear-ssh #look at the structure and add the necessary folders
dropbear-ssh being a script in which ther will be your only command:
Code: Select all
dropbear start
Code: Select all
dir2xzm dropbear-ssh
Prendre son temps, profiter de celui qui passe.
-
- White ninja
- Posts: 9
- Joined: 11 Apr 2017, 10:41
- Distribution: Porteus v4 x64
- Location: England
Re: /etc/init.d/script not working at boot
There is a comment in the activate script stating that rc.d scripts will not be activated by the OS, only by the activate script. Was there any resolution to this issue? Or any workaround without manually putting something into rc.local?
-
- White ninja
- Posts: 13
- Joined: 20 Mar 2017, 14:41
- Distribution: Porteus Desktop
- Location: Czech Rep.
Re: /etc/init.d/script not working at boot
I ended with "overwriting" system scripts (/etc/rc.d/rc.M, rc.local, rc.inet1) by my package. I would prefer other solution, but this works for me.
Michal
Michal
-
- White ninja
- Posts: 9
- Joined: 11 Apr 2017, 10:41
- Distribution: Porteus v4 x64
- Location: England
Re: /etc/init.d/script not working at boot
Thanks, I might modify linuxrc to look for a $modulename.init file and execute that on startup, then I can just tell that to activate my rc script(s), and it will be expandable.
Alternatively I guess I could just stick in rc.local I guess.
I'm surprised no-one else has had issues with this.
Alternatively I guess I could just stick in rc.local I guess.
I'm surprised no-one else has had issues with this.
-
- Full of knowledge
- Posts: 2564
- Joined: 25 Jun 2014, 15:21
- Distribution: 3.2.2 Cinnamon & KDE5
- Location: London
Re: /etc/init.d/script not working at boot
@ Alpvax
Welcome to Porteus. BTW noticed a test version being used.
@ francois
What's the score with test version issues?
Welcome to Porteus. BTW noticed a test version being used.
@ francois
What's the score with test version issues?
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
-
- White ninja
- Posts: 9
- Joined: 11 Apr 2017, 10:41
- Distribution: Porteus v4 x64
- Location: England
Re: /etc/init.d/script not working at boot
Thanks, I am using it in a live-only setup (no saved changes) as a way to learn a lot about the linux structure. (All configuration has to be done from files or scripts, not from the GUI). I like to live on the bleeding-edgeBogomips wrote:@ Alpvax
Welcome to Porteus. BTW noticed a test version being used.
@ francois
What's the score with test version issues?
I have created a module which will mount my work samba share and map shortcuts (in thunar), but unfortunately there is no way to get the startup script to run when it is loaded on boot. This does not seem to be a bug, as it has been well documented within the script files. It would be a useful feature, maybe with a cheatcode to enable/disable it.
-
- Full of knowledge
- Posts: 2564
- Joined: 25 Jun 2014, 15:21
- Distribution: 3.2.2 Cinnamon & KDE5
- Location: London
Re: /etc/init.d/script not working at boot
Workaroundmichalh wrote: /etc/rc.d/dropbear start
into /etc/rc.d/rc.local, the scipt is run at boot and works, but I do not like this solution. I would prefer not having to edit system scripts, it all should be done in the XZM module.
For starters, do not put module in /porteus/modules. Then in rc.local script add lineAlpvax wrote:There is a comment in the activate script stating that rc.d scripts will not be activated by the OS, only by the activate script.
Code: Select all
activate /Path/to/Module.xzm
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
-
- White ninja
- Posts: 9
- Joined: 11 Apr 2017, 10:41
- Distribution: Porteus v4 x64
- Location: England
Re: /etc/init.d/script not working at boot
That solved most of the problem, however the module also added some thunar bookmarks, which did not seem to be replaced by the ones in the module, althought they were replaced correctly when the module was in modules. De-activating and re-activating does not seem to fix the issue.
I may just have to split this module into multiple modules.
I may just have to split this module into multiple modules.
-
- Full of knowledge
- Posts: 2564
- Joined: 25 Jun 2014, 15:21
- Distribution: 3.2.2 Cinnamon & KDE5
- Location: London
Re: /etc/init.d/script not working at boot
This is not very clear. Does not provide a good idea of the sequence followed.Alpvax wrote:the module also added some thunar bookmarks, which did not seem to be replaced by the ones in the module, althought they were replaced correctly when the module was in modules.
What comes across is that the module contains these bookmarks in some file or other. So when in modules, script was not run and files remained intact. However upon activation from rc.local, script was run which changed data in these files?
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
-
- White ninja
- Posts: 9
- Joined: 11 Apr 2017, 10:41
- Distribution: Porteus v4 x64
- Location: England
Re: /etc/init.d/script not working at boot
The module contains a settings file for thunar, and a script that changes additional settings based on access to a samba share.
When activated from modules, the settings from the file are applied, but the script is not executed.
When activated via "activate <module>.xzm", the settings file does not overwrite the existing settings file, but the script gets executed.
When activated from modules, the settings from the file are applied, but the script is not executed.
When activated via "activate <module>.xzm", the settings file does not overwrite the existing settings file, but the script gets executed.
-
- Full of knowledge
- Posts: 2564
- Joined: 25 Jun 2014, 15:21
- Distribution: 3.2.2 Cinnamon & KDE5
- Location: London
Re: /etc/init.d/script not working at boot
Do not understand this, because settings file of module should have overlaid existing settings file (from changes?)
Try this and see what happens.
Try this and see what happens.
- Create directory in module
- Copy settings file of module to this directory as well
- Append to script a statement to copy file from this directory to the directory required.
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
-
- White ninja
- Posts: 9
- Joined: 11 Apr 2017, 10:41
- Distribution: Porteus v4 x64
- Location: England
Re: /etc/init.d/script not working at boot
After doing what you said, the file has been replaced (~/.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml) but the changes haven't taken effect in thunar itself. Maybe thunar needs to be reinitialised to read the file?
I think I will just move the module back to modules, and run the script from rc.local.
I think I will just move the module back to modules, and run the script from rc.local.
-
- Full of knowledge
- Posts: 2564
- Joined: 25 Jun 2014, 15:21
- Distribution: 3.2.2 Cinnamon & KDE5
- Location: London
Re: /etc/init.d/script not working at boot
Don't know much about Thunar, but dare say would be analogous to way PaleMoon works.Alpvax wrote:file has been replaced (~/.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml) but the changes haven't taken effect in thunar itself. Maybe thunar needs to be reinitialised to read the file?
Dug this up
Seems clear Thunar will pick up the values needed at start up. So, one suggestion is to have in guiexec script:xfce save thunar setting in
~/.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml
For example, to change an attribute of the window, as the width of the sidebar, type:
xfconf-query --channel thunar --property /last-separator-position --set 400
you can create a shell script that changes the values first and then run thunar.
ie, create a file thunar.sh as:
#!/bin/bash
xfconf-query --channel thunar --property /last-side-pane --set ThunarTreePane
xfconf-query --channel thunar --property /last-separator-position --set 200
thunar &
and run it by typing:
sh thunar.sh
Code: Select all
pkill thunar
thunar &
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB