Open ghost opened 10 years ago
Thank you! I was not expecting people other than myself to use servman. :)
Just a disclaimer: When a service fails, servman doesn't know what worked and what didn't. You will have to do it manually. Anyway, the service file is simple and it should be easy to type the command directly and see what is not working.
Am running with busybox will switch too sinit at some point. Service files are easy to work out systemd service file tell you mostly what commands to use. Have got connman running wired network not tried wireless yet.
Minirc worked ok, but it lacks the rc.d style scripts that make it easier to work with. The less you edit the main script the better.
Not sure if you are running services in the background might speed up boot time, not that it is that slow.
On Friday, April 18, 2014, ggjp notifications@github.com wrote:
Thank you! I was not expecting people other than myself to use servman. :)
Just a disclaimer: When a service fails, servman doesn't know what worked and what didn't. You will have to do it manually. Anyway, the service file is simple and it should be easy to type the command directly and see what is not working.
— Reply to this email directly or view it on GitHubhttps://github.com/ggjp/servman/issues/1#issuecomment-40844093 .
Kev
Yes, I just wanted to sepate the boot and shutdown process from service management. It just feels simpler to me.
As for starting services in the background, you can add a '&' at the end of the line starting the service in your boot script. However, I am not sure they will be started in the order you start them in your script. And servman will output the result anyway. Maybe, I could add a quiet switch...
If you do not mind I might fork servman and I can mess around with it more. Would like to use two files, inittab and rc feeling that servman could be part of rc script (for now).
Of course with sinit you do not need inittab....
Two paths are open regarding system settings, either load them from /etc config files such as hostname, timezone or add them as variables in rc script.
Head is full of ideas, I like servman very much :-)
On Saturday, April 19, 2014, ggjp notifications@github.com wrote:
Yes, I just wanted to sepate the boot and shutdown process from service management. It just feels simpler to me.
As for starting services in the background, you can add a '&' at the end of the line starting the service in your boot script. However, I am not sure they will be started in the order you start them in your script. And servman will output the result anyway. Maybe, I could add a quiet switch...
— Reply to this email directly or view it on GitHubhttps://github.com/ggjp/servman/issues/1#issuecomment-40860061 .
Kev
That's ok to fork it. I made servman for myself trying to simplify my booting process. My first init (consciously) was systemd. If I were used to sysvinit or other init, I might also consider inittab and other configurations to be simple in my setup.
I am using inittab as busybox init looks for it on boot. Simply removed getty lines from rc.
Wondering if using TZ as a variable at start of script saves you typing it twice?
Am using /etc/hostname setting it using
echo $(</etc/hostname) > (sorry on my ipad just typing out loud!)
Or again just use a variable and direct that.
Think hwclock as a service sounds like a good idea, reduces rc code and shows anyone else using servman how to write there own services. I just look at systemd .service files for clues :-)
Might remove status from service files, you could simply use prep to check (if I can get regex right!)
On Saturday, April 19, 2014, ggjp notifications@github.com wrote:
That's ok to fork it. I made servman for myself trying to simplify my booting process. My first init (consciously) was systemd. If I were used to sysvinit or other init, I might also consider inittab and other configurations to be simple in my setup.
— Reply to this email directly or view it on GitHubhttps://github.com/ggjp/servman/issues/1#issuecomment-40879863 .
Kev
I have seen many ways to set the hostname, the simplest being: hostname "your hostname" I might change my script to this. Using /etc/hostname allows me to keep both systemd and sinit installed on my machine and set the hostname at only one place.
I consider hwclock more like hostname (ie something that should be set in rc script). I don't know what a stop and status function for hwclock would look like, for example.
Also, if you want more clues to build your service files, you change check the ones provided by the openrc packages in the AUR in addition to those of systemd.
On second thought, you are right about hwclock. I moved it to a service file.
Why not add TZ at start of rc script as a variable, for a simple set up there is no real need for an rc.conf style config file. Really depends on how far you want to go. hwclock does show very clearly how it start or stops. The less you need to edit rc the better as it it vital for system to boot....
On 20 April 2014 10:36, ggjp notifications@github.com wrote:
On second thought, I are right about hwclock. I moved it to a service file.
— Reply to this email directly or view it on GitHubhttps://github.com/ggjp/servman/issues/1#issuecomment-40891366 .
Have forked servman, made some minor changes need to test it first. Check out hwclock. I am going to try and run all services in rc.d from rc script. My plan is to remove the need for servman just use main rc script. Might even try to run all services and stop all services (daemons) present in rc.d without the need for $SERVICES.
Possibly a one liner.....
MrG
On 20 April 2014 10:36, ggjp notifications@github.com wrote:
On second thought, I are right about hwclock. I moved it to a service file.
— Reply to this email directly or view it on GitHubhttps://github.com/ggjp/servman/issues/1#issuecomment-40891366 .
Nice! I will keep an eye on it.
Your hwclock file seems like the one I added before you forked. ;)
Not got around to all the files yet, so daemons are your versions. Might add swap file too using code from rc. Going to move rc to /sbin seems a more natural place for it.
While I think of it what about an rc.local file for other system settings.
Need to find a way to test speed of boot.
Then I will work on daemon status
On Sunday, April 20, 2014, ggjp notifications@github.com wrote:
Nice! I will keep an eye on it.
Your hwclock file seems like the one I added before you forked. ;)
— Reply to this email directly or view it on GitHubhttps://github.com/ggjp/servman/issues/1#issuecomment-40906013 .
Kev
Only issue I have is that hwclock does not seem to be working as a service, cannot get anything from pgrep. Might add it back into init(). Gradually adding in servman into rc script, just got stop,start,restart to sort out. System even under a VM boots fast, runs ok have not come across any major issues.
On 20 April 2014 22:58, ggjp notifications@github.com wrote:
Nice! I will keep an eye on it.
Your hwclock file seems like the one I added before you forked. ;)
— Reply to this email directly or view it on GitHubhttps://github.com/ggjp/servman/issues/1#issuecomment-40906013 .
hwclock doesn't start a process, hence pgrep not applying to it. My status function for hwclock simply returns 0 (success).
That explains it, had a feeling it is not a running process...
On 22 April 2014 09:53, ggjp notifications@github.com wrote:
hwclock doesn't start a process, hence pgrep not applying to it. My status function for hwclock simply returns 0 (success).
— Reply to this email directly or view it on GitHubhttps://github.com/ggjp/servman/issues/1#issuecomment-41017228 .
Have put hwclock back in rc, added rc.local and loadkeys for console. Be nice to have coloured output, but it would really add anything to speed of script. Have given fork a temporary name of busyrc (more to reduce confusion).
Reboot and shutdown took some working out....
On Tuesday, April 22, 2014, Mr Green mrgreen@archbang.org wrote:
That explains it, had a feeling it is not a running process...
On 22 April 2014 09:53, ggjp notifications@github.com<javascript:_e(%7B%7D,'cvml','notifications@github.com');
wrote:
hwclock doesn't start a process, hence pgrep not applying to it. My status function for hwclock simply returns 0 (success).
— Reply to this email directly or view it on GitHubhttps://github.com/ggjp/servman/issues/1#issuecomment-41017228 .
Kev
Since you have rc in sbin, typing "sudo rc reboot" is not too hard. I have also found another solution which I find clean. acpid handles various events in /etc/acpi/handler.sh. I just bind my power button to reboot. I don't shutdown my system often so it is not important that I have an easy way to shutdown.
I am using busybox, so have this for reboot
reboot) shutdown busybox reboot;;
Which works, you can run sudo rc reboot...
Looking at other init scripts one thing I have noticed is the removal of tmp files, not sure yet which ones are involved. Need to look at more detail at Crux (What Arch was based on). Will at some point add start,stop,restart of daemons (might be useful for testing) too rc script.
Is sinit just simply smaller than busybox? or it is simply for booting system rather than adding a load of extra commnds.
On 22 April 2014 20:17, ggjp notifications@github.com wrote:
Since you have rc in sbin, typing "sudo rc reboot" is not too hard. I have also found another solution which I find clean. acpid handles various events in /etc/acpi/handler.sh. I just bind my power button to reboot. I don't shutdown my system often so it is not important that I have an easy way to shutdown.
— Reply to this email directly or view it on GitHubhttps://github.com/ggjp/servman/issues/1#issuecomment-41082074 .
You can look at the source code of sinit (~85 lines of C). It really just call your rc script. It also does something I don't understand yet (handles child maybe...). In comparison, busybox code for init is a lot bigger.
Might switch to it, think your post on Arch forums stated you need to point config.h to /sbin/rc .... would need to add back in inittab lines or could I call inittab (bit of a long way round!!!). That would help me for testing at least.
On 22 April 2014 20:51, ggjp notifications@github.com wrote:
You can look at the source code of sinit (~85 lines of C). It really just call your rc script. It also does something I don't understand yet (handles child maybe...). In comparison, busybox code for init is a lot bigger.
— Reply to this email directly or view it on GitHubhttps://github.com/ggjp/servman/issues/1#issuecomment-41087177 .
sinit doesn't handles inittab. You would have to move what is in your inittab to your rc script. I find it simpler that way (rather than handling inittab and rc which have the same function).
Well it would reduce files to one script and a folder (not including rc.local). Will give it go tomorrow. Going to have to add in commands again for shutdown etc....
On Tuesday, April 22, 2014, ggjp notifications@github.com wrote:
sinit doesn't handles inittab. You would have to move what is in your inittab to your rc script. I find it simpler that way (rather than handling inittab and rc which have the same function).
— Reply to this email directly or view it on GitHubhttps://github.com/ggjp/servman/issues/1#issuecomment-41088739 .
Kev
Running sinit now and it boots even faster ;-) just got to sort poweroff/reboot What on earth is /opt/sbase/ ? Figure I need to call rc shutdown and check sinit
On 22 April 2014 20:51, ggjp notifications@github.com wrote:
You can look at the source code of sinit (~85 lines of C). It really just call your rc script. It also does something I don't understand yet (handles child maybe...). In comparison, busybox code for init is a lot bigger.
— Reply to this email directly or view it on GitHubhttps://github.com/ggjp/servman/issues/1#issuecomment-41087177 .
I just needed to add commands for shutdown and reboot into config.h (my bad) now will try and work out how to reboot from rc script....
On 23 April 2014 08:25, Mr Green mrgreen@archbang.org wrote:
Running sinit now and it boots even faster ;-) just got to sort poweroff/reboot What on earth is /opt/sbase/ ? Figure I need to call rc shutdown and check sinit
On 22 April 2014 20:51, ggjp notifications@github.com wrote:
You can look at the source code of sinit (~85 lines of C). It really just call your rc script. It also does something I don't understand yet (handles child maybe...). In comparison, busybox code for init is a lot bigger.
— Reply to this email directly or view it on GitHubhttps://github.com/ggjp/servman/issues/1#issuecomment-41087177 .
I installed sbase-git and ubase-git from the AUR, which provides tools similar to busybox's. These packages are installed in /opt/sbase. They are unrelated to sinit (though made by the same author).
As for shutdown and reboot, I don't use sinit for them. I just call my shutdown and reboot functions directly.
Looking at your rc you have
/opt/sbase/bin/halt -r;;
Which are called via shutdown....
On Wednesday, April 23, 2014, ggjp notifications@github.com wrote:
I installed sbase-git and ubase-git from the AUR, which provides tools similar to busybox's. These packages are installed in /opt/sbase. They are unrelated to sinit (though made by the same author).
As for shutdown and reboot, I don't use sinit for them. I just call my shutdown and reboot functions directly.
— Reply to this email directly or view it on GitHubhttps://github.com/ggjp/servman/issues/1#issuecomment-41216192 .
Kev
Yes, I can type "/etc/init.d/rc reboot" to reboot my machine. The shutdown function in my rc script prepares everything for shutdown, then it either reboots or shutdowns with "/opt/sbase/bin/halt -r" (or -p).
Installed sbase and ubase, so will add in commands again, would there be any mileage in moving ubase halt to sbin? Or maybe linking it, opt does seem an unnatural place for it, well for arch anyway.
On Thursday, April 24, 2014, ggjp notifications@github.com wrote:
Yes, I can type "/etc/init.d/rc reboot" to reboot my machine. The shutdown function in my rc script prepares everything for shutdown, then it either reboots or shutdowns with "/opt/sbase/bin/halt -r" (or -p).
— Reply to this email directly or view it on GitHubhttps://github.com/ggjp/servman/issues/1#issuecomment-41225324 .
Kev
It would conflict with util-linux and coreutils and tar and kmod and ... It would be all very hard to remove them. I think the maintainer of sbase did what was right for Arch. See: https://wiki.archlinux.org/index.php/Arch_filesystem_hierarchy#.2Fopt:_Problematic_packages
Well I do not think he is wrong, if it works does it matter.... Finally got halt working (in a manner of speaking), check sinit thread on arch forums. If I can get this working might try sinit with initscripts-fork (but that is something I will not post on arch forums as it involves removing systemd)
On 24 April 2014 08:22, ggjp notifications@github.com wrote:
It would conflict with util-linux and coreutils and tar and kmod and ... It would be all very hard to remove them. I think the maintainer of sbase did what was right for Arch. See: https://wiki.archlinux.org/index.php/Arch_filesystem_hierarchy#.2Fopt:_Problematic_packages
— Reply to this email directly or view it on GitHubhttps://github.com/ggjp/servman/issues/1#issuecomment-41250758 .
I follow the sinit thread on Arch forums. Unfornately, I will only be able to put more time on this next week. I will check initscripts also.
Quick set up of initscripts and compared too servman they are painfully slow. Sure if does more but still should be nearly as quick. Think many arch users would run servman like init scripts but are afraid it goes against what arch stands for. Catch up with you soon ;-)
On 24 April 2014 08:59, ggjp notifications@github.com wrote:
I follow the sinit thread on Arch forums. Unfornately, I will only be able to put more time on this next week. I will check initscripts also.
— Reply to this email directly or view it on GitHubhttps://github.com/ggjp/servman/issues/1#issuecomment-41253279 .
Am trying out servman on a virtual machine and am quite impressed. For testing I am running it with busybox at the moment. Made some changes to rc script mostly for hostname and timezone. Easily created my own init.d/all files for connman and dbus (had to modify to get it too work with dbus-eudev). Need to look at locales next.....
Thanks for sharing
Mr Green
ArchBang Linux