<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://dev1galaxy.org/extern.php?action=feed&amp;tid=6966&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / [SOLVED] Question about update-rc.d]]></title>
		<link>http://dev1galaxy.org/viewtopic.php?id=6966</link>
		<description><![CDATA[The most recent posts in [SOLVED] Question about update-rc.d.]]></description>
		<lastBuildDate>Sun, 15 Dec 2024 01:21:36 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: [SOLVED] Question about update-rc.d]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=53434#p53434</link>
			<description><![CDATA[<p>oh man i know that, got a couple rolls of sheet metal, some 1/8th spools of wire, some lenghts of industrial 4 conductor wire i gotta turn to extension cords one day and a good hold of pvc pipe that i keep telling myself i&#039;ll turn into a phone holder for an old tripod and the rest into a recurve bow... and that is just the stuff i&#039;ve more or less thought about what to do with, then i got a good chunk of half written software i gotta sit down and polish</p>]]></description>
			<author><![CDATA[dummy@example.com (EDX-0)]]></author>
			<pubDate>Sun, 15 Dec 2024 01:21:36 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=53434#p53434</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] Question about update-rc.d]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=53433#p53433</link>
			<description><![CDATA[<div class="quotebox"><blockquote><div><p>thanks, i either make stuff that is very useful or very useless, no in between.</p></div></blockquote></div><p>I seem to do the same thing, but can&#039;t bring myself to chunk &#039;em, I have a &quot;crap&quot; folder I throw into. Wife asked me one day why I keep that stuff at all, and I told her it&#039;s for the same reason I have two full totes of old wire, cabling and cords in the garage, lol. You just never know when it _might_ become useful. <img src="http://dev1galaxy.org/img/smilies/wink.png" width="15" height="15" alt="wink" /></p>]]></description>
			<author><![CDATA[dummy@example.com (greenjeans)]]></author>
			<pubDate>Sat, 14 Dec 2024 19:21:40 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=53433#p53433</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] Question about update-rc.d]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=53426#p53426</link>
			<description><![CDATA[<p>thanks, i either make stuff that is very useful or very useless, no in between.</p>]]></description>
			<author><![CDATA[dummy@example.com (EDX-0)]]></author>
			<pubDate>Fri, 13 Dec 2024 03:21:59 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=53426#p53426</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] Question about update-rc.d]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=53425#p53425</link>
			<description><![CDATA[<p>Marking this as solved.</p><p>@EDX-0 still checking out what you&#039;re doing, good stuff!</p>]]></description>
			<author><![CDATA[dummy@example.com (greenjeans)]]></author>
			<pubDate>Fri, 13 Dec 2024 02:26:32 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=53425#p53425</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] Question about update-rc.d]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=53409#p53409</link>
			<description><![CDATA[<p>So I cobbled one together myself late last night, it&#039;s not pretty but yet it works right now, just a proof-of-concept for me really, but it works in terminal if you su to root and run it, it also works as a normal user in terminal if I use gksu.sh with the command to run it, and it authenticates and runs properly.</p><p>It checks current runlevel first, then spits out a yad dialog giving you&#160; level.<br />Then pops up the dialog that changes runlevels<br />Afterwards runs &quot;runlevel&quot; again to check new state of runlevel and report that.</p><p>ETA: Updated 12-18-24, this one mo bettah. Adds another dialog for if the runlevel was not changed. Cleaned up some useless code. expanded some windows due to title cutoff.</p><div class="codebox"><pre class="vscroll"><code>#!/bin/sh

# Copyleft: greenjeans 2024, use as you see fit.
# This is free software with NO WARRANTY. Use at your own risk!
# Depends: yad

# DESCRIPTION:
# Simple script to change run levels. Requires root access so authentication is needed.
# In Vuu-do 5, cups, cups-browsed, and bluetooth are disabled by default in runlevel 2,
# which is the default runlevel you boot into in Devuan/Debian systems. 
# But they are all enabled in runlevel 3, and switching enables and starts the services, 
# and switching back stops/disables them. A .desktop is used to include in menu.
# Can also be used in terminal: levelswitch2 (must be root).

crlev=$(runlevel &quot;$1&quot;)

lv=$(echo &quot;$crlev&quot; | awk -F &#039; &#039; &#039;{ print $2 }&#039;)

yad --fixed --form --width=400 --window-icon=start-here --height=100 --center --borders=10 --button=gtk-ok --title=&quot;Runlevel status&quot; --text-align=center --text=&quot;
Current runlevel is:  $lv&quot;

rlev=$(yad --fixed --window-icon=start-here --center --borders=10 --form --title=&quot;Enable/disable cups and bluetooth&quot; --text-align-center --field=&quot;Select from drop-down menu:&quot;:CB --text-align=center --wrap --text=&quot;
By default Vuu-do boots into runlevel 2, and cups and bluetooth are disabled on startup for faster boot.

Choose below to enable and start them for this session by switching 
to runlevel 3, or turn them back off by switching to run level 2.
---------------------------------------------------------------------------------------------------------------
Note: Default runlevel on boot can be changed by editing /etc/inittab as root.
---------------------------------------------------------------------------------------------------------------

Choose 3 to enable cups and bluetooth, 2 for disable
&quot; &#039;Choose runlevel!2!3&#039;

)

rl=$(echo &quot;$rlev&quot; | awk &#039;BEGIN {FS=&quot;|&quot; } { print $1 }&#039;)

if [ &quot;$rl&quot; = &#039;Choose runlevel&#039; ]
then echo &quot;runlevel was not changed&quot;
else telinit &quot;$rl&quot;
fi

crlev2=$(runlevel &quot;$1&quot;)

lv2=$(echo &quot;$crlev2&quot; | awk -F &#039; &#039; &#039;{ print $2 }&#039;)

if [ &quot;$lv2&quot; = &quot;$lv&quot; ]
then yad --fixed --form  --width=500 --height=100 --window-icon=start-here --center --borders=10 --button=gtk-ok --title=&quot;Runlevel status&quot; --text-align=center --text=&quot;
The runlevel has not been changed, current level is:  $lv2&quot;
else yad --fixed --form  --width=400 --height=100 --window-icon=start-here --center --borders=10 --button=gtk-ok --title=&quot;Runlevel status&quot; --text-align=center --text=&quot;
The current runlevel is now:  $lv2&quot;
fi</code></pre></div><p>And the .desktop:</p><div class="codebox"><pre><code>[Desktop Entry]
Type=Application
Name=Enable/disable cups+bluetooth
Comment=Enable services by changing runlevels
Icon=emblem-system
Exec=gksu.sh levelswitch2
Categories=Settings;</code></pre></div><p>gksu.sh :</p><div class="codebox"><pre><code># Script to convert gksu to pkexec for extensions already written
# without adding a lot of code to the .desktop command line.
# Usage: &quot;gksu.sh [program]&quot;

#!/bin/bash
if [ -z $1 ]; then
 echo -e &quot;at least 1 argument required!\n&quot; &gt;&gt; /dev/stderr
 exit 1
fi
COMMAND=$1
shift #shift first arg
for ARG in &quot;$@&quot;
do
 if [ -z &quot;$ARGS&quot; ]; then
  ARGS=&quot;$ARG&quot;
 else
  ARGS=&quot;$ARGS $ARG&quot;
 fi 
done
ARGS=\&#039;$ARGS\&#039;
eval pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY $COMMAND $ARGS
exit 0</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (greenjeans)]]></author>
			<pubDate>Thu, 12 Dec 2024 14:45:06 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=53409#p53409</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] Question about update-rc.d]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=53403#p53403</link>
			<description><![CDATA[<p>fun i just so happen to have some useful pieces of code on other scripts in <a href="https://github.com/eylles/devuan-scripts/" rel="nofollow">https://github.com/eylles/devuan-scripts/</a> (check every single one, take every piece of code ya want, it is licensed apache2)</p><p>in short is to decide if using sudo, sudo with askpass or pkexec:</p><div class="codebox"><pre><code>  has_tty=&quot;&quot;
  if tty | grep -qF -e &quot;dev/tty&quot; -e &quot;dev/pts&quot;; then
    has_tty=1
  fi
  if [ -n &quot;$has_tty&quot; ]; then
    sudo command
  else
    if [ -n &quot;$SUDO_ASKPASS&quot; ]; then
      sudo -A command
    else
      pkexec command
    fi
  fi</code></pre></div><p>the content of $SUDO_ASKPASS is usually some program to read a password from the user, some use dmenu or rofi but both programs advice not to use them for password prompts... on my system i set SUDO_ASKPASS to <span class="bbc">/usr/bin/ssh-askpass</span> which is provided by the <span class="bbc">ssh-askpass-gnome</span> package, tho i also got a polkit authentication agent for programs like gparted and the like, on my case i run <span class="bbc">/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1</span> as a daemon inside my user session the program is provided by the <span class="bbc">policykit-1-gnome</span> package.</p>]]></description>
			<author><![CDATA[dummy@example.com (EDX-0)]]></author>
			<pubDate>Thu, 12 Dec 2024 00:21:47 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=53403#p53403</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] Question about update-rc.d]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=53400#p53400</link>
			<description><![CDATA[<p>Nice, i&#039;m going to take look a look thanks! I didn&#039;t mess with symlinks, just used update-rc.d to disable those 3 services and have done nothing else, I timed the bootup and it did make it a bit quicker. Booting super-fast off a liveUSB.</p><p>Seems like you could take the password in yad, but I usually just make a .desktop for the whole thing, and used to use gksu in the exec line so it the system authorization dialog. Then I can use it in /usr/share/applications, and the obmenu-generator picks it up automatically and gives me a menu entry to activate, or in the .local files for context menu stuff, or both.</p><p>Well cool, they&#039;re off now already in runlevel 2, I just need to run update-rc.d and give a specific instruction about enabling it in 3.</p><p>Man that&#039;s even better, I don&#039;t even have to really make a script, just a .desktop that pxexec&#039;s the &quot;init 3 &quot;command. That&#039;s as simple as it gets right there, again, really appreciate the help!</p>]]></description>
			<author><![CDATA[dummy@example.com (greenjeans)]]></author>
			<pubDate>Wed, 11 Dec 2024 20:47:05 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=53400#p53400</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] Question about update-rc.d]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=53396#p53396</link>
			<description><![CDATA[<p>After &#039;init 3&#039; command, you don&#039;t need to use the service command. They will start (unless you screwed with all the symlinks.) I use sysv-rc-conf to turn services off in runlevel 2.</p><p>Not sure what you have in mind, but one way to get root would be to have yad start a terminal that runs <span class="bbc">su -c &#039;init 3&#039;</span> and then it&#039;ll ask for root pass in the terminal. If you don&#039;t want the user to see a terminal, I think you can use yad to take a password and feed it to the command. I&#039;m not as clear on this. See /usr/lib/refracta2usb/functions/function.mkloop around lines 104 and 176 for an example.</p>]]></description>
			<author><![CDATA[dummy@example.com (fsmithred)]]></author>
			<pubDate>Wed, 11 Dec 2024 18:49:51 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=53396#p53396</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] Question about update-rc.d]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=53394#p53394</link>
			<description><![CDATA[<p>Cool! Yeah this is for the new Vuu-do, so should be fine. Just thinking out loud here as I process new info, but:</p><p>So I leave those services disabled in 2. </p><p>Leave them enabled them in 3, which is not the default level I boot to, so they won&#039;t be running and still won&#039;t be started and won&#039;t be part of the boot process.</p><p>Add a script + yad that switches to run level 3 and then simply invokes the &quot;service&quot; commands to start them.</p><p>It&#039;s perfect for what I want to do.</p><p>Thanks fsmithred and EDX-0, and I won&#039;t forget to credit y&#039;all in the script description and such!</p>]]></description>
			<author><![CDATA[dummy@example.com (greenjeans)]]></author>
			<pubDate>Wed, 11 Dec 2024 17:13:28 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=53394#p53394</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] Question about update-rc.d]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=53393#p53393</link>
			<description><![CDATA[<p>No issues going to runlevel 3 except you have to be root (or sudo). Just don&#039;t try this on a distro that disables the display manager in runlevel 3 (like Refracta desktop isos). In that case you&#039;d have to do &#039;init 4&#039; or &#039;init 5&#039; or re-enable the dm in 3.</p>]]></description>
			<author><![CDATA[dummy@example.com (fsmithred)]]></author>
			<pubDate>Wed, 11 Dec 2024 17:02:12 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=53393#p53393</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] Question about update-rc.d]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=53392#p53392</link>
			<description><![CDATA[<div class="quotebox"><blockquote><div><p>Turn them off in runlevel 2, and then the command to turn them on is</p><p>init 3</p></div></blockquote></div><p>Wow, perfect, short and sweet, and as per your usual answers to me I just have to know why it works and I just went nuts on reading documentation about init and run levels that I really should have done long ago.</p><p>So no issues at all in just switching to run level 3?</p>]]></description>
			<author><![CDATA[dummy@example.com (greenjeans)]]></author>
			<pubDate>Wed, 11 Dec 2024 16:43:22 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=53392#p53392</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] Question about update-rc.d]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=53388#p53388</link>
			<description><![CDATA[<p>Turn them off in runlevel 2, and then the command to turn them on is </p><div class="codebox"><pre><code>init 3</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (fsmithred)]]></author>
			<pubDate>Wed, 11 Dec 2024 10:17:05 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=53388#p53388</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] Question about update-rc.d]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=53385#p53385</link>
			<description><![CDATA[<p>libgtk2-perl is a dependency, not in repo, guess I need to find that too to see if it can work.</p>]]></description>
			<author><![CDATA[dummy@example.com (greenjeans)]]></author>
			<pubDate>Wed, 11 Dec 2024 03:01:44 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=53385#p53385</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] Question about update-rc.d]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=53384#p53384</link>
			<description><![CDATA[<p>Sonofagun, your search-fu is way better than mine, didn&#039;t even think about Ubuntu archives...searched debian and old references and didn&#039;t come up with anything.</p><p>Totally not surprising it&#039;s perl, some of the best stuff is. I&#039;ve got a whole bunch of Trizen&#039;s other stuff laying around here besides obmenu-generator, that guy does some amazing work in perl.</p><p>ETA: lawd, I need to step away from the computer for a bit, or stop drinking this cheap walmart bourbon, I actually did find a source tar.gz two days ago, downloaded and meant to build but forgot about it.</p><p>Wow, I&#039;m taking a day off tomorrow, my brain has gone to mush.</p>]]></description>
			<author><![CDATA[dummy@example.com (greenjeans)]]></author>
			<pubDate>Wed, 11 Dec 2024 02:51:20 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=53384#p53384</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] Question about update-rc.d]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=53379#p53379</link>
			<description><![CDATA[<p>boot up manager went by as bum in the debian packages <a href="https://tracker.debian.org/pkg/bum" rel="nofollow">https://tracker.debian.org/pkg/bum</a> wonder if there&#039;s a way to get the source packages from debian jessie somehow</p><p>edit: took me a while but i found something on the archive of old ubuntu releases <a href="https://old-releases.ubuntu.com/ubuntu/pool/universe/b/bum/" rel="nofollow">https://old-releases.ubuntu.com/ubuntu/ … rse/b/bum/</a></p><p>edit 2: so it is a program written in perl, somehow not surprised...</p>]]></description>
			<author><![CDATA[dummy@example.com (EDX-0)]]></author>
			<pubDate>Wed, 11 Dec 2024 00:57:22 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=53379#p53379</guid>
		</item>
	</channel>
</rss>
