-
AuthorSearch Results
-
January 27, 2022 at 7:44 pm #76254
In reply to: Stop and restart service. How?
Anonymous
I _almost_ posted (from a websearch query: “tutorial sysv initscript”) a link to that identical cyberciti page
Anyhow, I am not familiar with “stubby”, but the script from the shortlink url looks reasonable.
How do I…
This is a sysV init thing, not proprietary to antiX.
Through the years I have probably posted a ‘splainer or walkthrough describing the sysV init and the boot process,
but I can’t find that post (I recall having invited others to followup by describing rc.local)…
edit:
found the prior post ~~ pasting most of its content, into a quotebox herehttp://www.antixforum.com/forums/topic/how-do-i-start-a-daemon/#post-48685
A SysV (aka SystemV) init walkthroughDuring boot, immediately following Linux kernel initialization, the init script executes /sbin/init
=== In the “live boot” scenario, an interim init (extracted from within the initrd)
=== is executed, and it performs a plethora of operations prior to calling
=== the switch_root command and handing off to /sbin/init/sbin/init reads /etc/initscript and consults /etc/inittab
(which governs a series of scripts required to complete the initialization process)
^—v
Next, /sbin/init (according to entries in /etc/inittab)
will exec /etc/xxxxxx passing to it the requested initial runlevel (as specified in /etc/inittab)===
=== above, I’m omitting some details in this draft
===The numbering convention for runlevels, across linux distributions, typically includes
0 = halt
1 = single-user mode (only runs /etc/rc.d/rc.sysinit; does not run /etc/rc.d/rc)
6 = reboot
and runlevels 2-3-4-5 are configured to achieve various forms of multi-user modeTheoretically, you could declare n configure additional runlevels 7 thru 9. If you configured
a “runlevel 7”, its operation would be no higher//better//later than the existing numbered runlevels,
(mentioned just for sake of completeness: Doing this would be accomplished by editing /etc/inittab )SysVinit goes directly to the runlevel specified in /etc/inittab; It does not consult
the scripts in the other levels. However, at each boot, we can provide a bootline
argument to override the configured default target runlevel.While a system is running, admin can command a switchover from one runlevel to another,
via the init (aka ‘telinit’) command. When switching runlevels, the init system assesses the difference
between the current and target runlevel. Any processes listed for the current level but not in the target
runlevel are killed using the kill scripts, then any listed for the target runlevel but not in the
current are executed. Items that exist in both run levels are left undisturbed.===
===
===on antiX (and other OSes using SysV init) all startup scripts for any process which will be started
when entering one (or several) of the runlevels, are stored in // read from the directory /etc/init.d/
.
The initscripts are processed in numerical order, according to your assigned script filenames.
.
After placing a new script into /etc/init.d/, you can use the tool (command) ____ update-rc.d _____
to generate symlinks ~~ one symlink will be added into each of the numbered /etc/rc[0-6]/ directories.
If the new script is to be stopped for a given runlevel, update-rc.d will preface the name of its symlink
with a K (kill); it the new script is intended to be started for that runlevel, an S (start) prefix
will be applied.
.
Learn by example: inspect the content of the various existing /etc/init.d/ “init scripts” and note
the convention(s) used in their declaratory header lines.
.
Various tutorials are available online. For example: wiki.linuxquestions.org/wiki/Creating_startup_scriptsnote: a process called via an initscript will not necessarily be a “daemon”.
(Many of ’em, run in order to perform prep, or housekeeping upon entering a runlevel then they immediately exit.)Here are some helpful web resources:
linuxfromscratch.org/lfs/view/9.0/chapter07/usage.html
boot-init-shutdown-sysv.htmlsome relevant manpages:
man boot
man init
man rc
man runlevel
man inittab
man sysv-rc-conf
man initscript
man update-rc.dWhen you place this initscript in /etc/init.d
running update-rc.d will parse the initscript and, based on finding the line
Default-Start: 2 3 4 5
will create symlinks:
/etc/rc2.d/stubby
/etc/rc3.d/stubby
/etc/rc4.d/stubby
/etc/rc5.d/stubbynote: Typically, a desktop user is booting straight to runlevel 5.
Each time the system initializes a given runlevel, the init system reads (follows) the symlinks present is the associated /etc/rc*.d/ directory, launching//exec()ing each item.
#!/bin/sh ### BEGIN INIT INFO # Provides: stubby # Required-Start: $local_fs $network # Required-Stop: $local_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: stubby service # Description: stubby, the secure DNS proxy ### END INIT INFO PATH=/bin:/usr/bin:/sbin:/usr/sbin NAME=stubby DAEMON=/usr/bin/stubby PIDFILE=/run/stubby.pid CONFIG=/etc/stubby/stubby.yml USER=stubby test -f $DAEMON || exit 0 . /lib/lsb/init-functions case "$1" in start) log_daemon_msg "Starting $NAME" touch $PIDFILE chown $USER $PIDFILE chmod 700 $PIDFILE start-stop-daemon --start --exec $DAEMON --pidfile $PIDFILE --chuid $USER --quiet --oknodo -- -C $CONFIG -g log_end_msg $? exit $? ;; stop) log_daemon_msg "Stopping $NAME" start-stop-daemon --stop --exec $DAEMON --pidfile $PIDFILE --remove-pidfile --user $USER --quiet --oknodo log_end_msg $? exit $? ;; restart) $0 stop && $0 start exit $? ;; status) status_of_proc -p "$PIDFILE" "$DAEMON" "$NAME" exit $? ;; *) echo "Usage: $0 {start|stop|restart|status}" exit 1 ;; esac- This reply was modified 1 year, 2 months ago by Brian Masinick. Reason: From skidoo
January 9, 2022 at 1:18 am #74858Memberentropyagent
$ ps -feww| grep -i log
root 1505 1 0 21:29 ? 00:00:02 runsvdir -P /etc/service log: log/./run: file does not exist chown: invalid user: ‘_runit-log:adm’ chpst: fatal: unknown user/group: _runit-logwhich seems to suggest that runsvdir, and therefore runit, is probably unhappy.
November 22, 2021 at 9:53 am #71477MemberModdIt
Done on antiX 21 Runit, sysv should make little difference.
I just tested this step by step, it worked, no warranty as user made system changes could be an issue.
This done on a fresh setup as I had made a frankenX where libs did not match. Live and learn.Install for a Brother MFC device, most steps are also needed for Brother Laser Multi functional devices.
Refer to Brother support for your specific printer model.For my MFC-J6710DW
CRITICAL: PREQUISITES 32 Bit Support. RUNNING CUPS SERVICE
Use Runit service manager, if you are not running the full antiX version ensure cups is installed, set it to run on start.
For 32 bit support:
sudo apt install lib32stdc++6 libc6-i386 lib32gcc-s1Now create the spooler directory:
sudo mkdir -p /var/spool/ Check this has been created, if not make a folder manualy
sudo chown lp:lp /var/spool/lpd
/var/spool/lpd/mfcj6710dw will be created by printer installer Check it is owned by lp:lp and as shown user lp.For debian you must specify the PATH environment variable.
Run the following command using the command line:
export PATH=$PATH:/usr/sbin
Download and run, as root the Brother Printer driver installer script, it is available on the US website.
I needed to enter bash to the rox console before the script would execute, it is written for BASH.
Should you prefer individual debfiles are available on the brother support download pages
Install is easy, enter sudo apt install in console then drag the file icon in to the terminal window,
the full path will be automagicaly setup. For files downloaded to a usb stick I had to copy them in to user download folder.If you use any papersize other than letter, or wish to make changes you can enter your defaults on localhost:631 cups interface
any graphical browser should do.Do a test print, enjoy or fault find, I hope the former.
- This topic was modified 1 year, 5 months ago by ModdIt.
- This topic was modified 1 year, 5 months ago by ModdIt. Reason: Fail due wrong libs
- This topic was modified 1 year, 5 months ago by ModdIt.
October 26, 2021 at 8:47 pm #69602Member
Xecure
Check the /etc/fstab configuration for your hard-drive.
chown needs to be done to the mountpoint, not the dev path.
Again, mount the device with thunar and run
echo $(findmnt -n /dev/sdb1)This will give all the configuration on how the device is mounted and to where.
If you only want the mountpoint:
findmnt -no TARGET /dev/sdb1Then use chown on that mountpoint,
antiX Live system enthusiast.
General Live Boot Parameters for antiX.October 26, 2021 at 5:52 pm #69588Memberwaldmattis
@Moddit
I typed into the terminal:sudo chown theo:theo /dev/sdb
and
sudo chown theo:theo /dev/sdb1and
sudo chown -R theo:theo /dev/sdb
and
sudo chown -R theo:theo /dev/sdb1I tried sdb1 in addition, because sdb did not work
October 26, 2021 at 5:36 pm #69586MemberModdIt
please tell us, what exactly did you enter in the terminal.
Like this ? sudo chown -R theo:theo /dev/sdb assuming username is theo or something else
October 26, 2021 at 5:22 pm #69585Memberwaldmattis
@Moddit
Thank you for helping again.
Unfortunately sudo chown $USER:$USER /path/to/mountpoint.
Replace /path/to/mountpoint with the real one.
did not help.
I will try sybok’s recipe.@sybok
Thank you for your advice!lsblk gives:
/dev/sdb1: LABEL=”Arbeitsplatte” UUID=”4be0acc3-e7a6-4bc7-8b15-b32de01c745a” BLOCK_SIZE=”4096″ TYPE=”ext4″ PARTUUID=”4b824c16-01″You wrote:
5) Create a mountpoint
sudo mkdir -p <full-path to the mountpoint>which part of the lsblk-output do I have to put instead of <full-path to the mountpoint> ?
Thank you!
Regards
KarlOctober 26, 2021 at 6:30 am #69571MemberModdIt
Hi Karl at present the drive is owned by root, the super user, group is also root (according to your info)
Open a terminal.
Run lsblk to find out where the partition is mounted in the filesystem. If we are talking about the 500GB drive
with a single partition it is /dev/sdbdo sudo chown $USER:$USER /path/to/mountpoint. Replace /path/to/mountpoint with the real one.
Which looks like you can translate to sudo chown theo:theo /dev/sdb
That changes owner to theo group to theo If you have files on the drive as it seems you have you will need to
change permissions on those too, to do so you can use the -R or recursive switch.sudo chown -R theo:theo /dev/sdb
It is well worth doing some reading on linux permissions, lot of info in the internet, just use metager and search chown.
Seems you or a group you are in has read permission, that allows you to open read copy. You want to be able to write
without becoming root.
https://devconnected.com/how-to-chown-recursive-on-linux/ is a pretty good introduction
https://devconnected.com/linux-file-permissions-complete-guide/#b_Using_chown in depth, maybe more than you or I will ever need.Should work, this is not always the case as other building blocks of linux can and do influence rights. Should we need more I have some
experiments to make but will find time fairly quickly.OT: I prefer to recommend Metager as first search engine, it is a very open project and not creating huge user profiles. Lot of Linux users
involved. Good meta search engine.
Duck duck go just came from darkness, I do not think it likely more private than alphabet daughter all pervasive googli.EDIT Good answers from sybok ;_) lot of ways to get things done in linux. I had asked what you want to use the disk for,
he goes in to that regarding naming.- This reply was modified 1 year, 6 months ago by ModdIt.
- This reply was modified 1 year, 6 months ago by ModdIt.
- This reply was modified 1 year, 6 months ago by ModdIt.
October 26, 2021 at 6:30 am #69570Member
sybok
Hi,
if you plan to use the 2nd built-in HDD regularly, you may wish to add a new item to ‘/etc/fstab’.
I am used to do this manually; I admit that there may be a better way of doing it.1) [Optional] Backup all the data on the disk
2) [Optional] Backup the existing ‘/etc/fstab’ e.g. using
sudo cp /etc/fstab /etc/bckp_fstab.old
3) Identify the HDD using size, e.g. the output of ‘lsblk’
Assume you use /dev/sdb1
4) Run ‘blkid’ to get UUID of the drive, example output:
/dev/sdb1 UUID="6da5a1fc-0cb3-43b3-b14a-53fa250efb12" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="80808080-01"
5) Create a mountpoint
sudo mkdir -p <full-path to the mountpoint>
In principle, you could re-use the ‘/media/Arbeitsplatte’ but I find that problematic if e.g. a USB-disk with same name would be connected.
6) Own it and change group,
sudo chown <username> -R <full-path to the mountpoint> && sudo chgrp <username> -R <full-path to the mountpoint>
6) Edit ‘/etc/fstab/’ by adding the below lines:#-> /dev/sdb1 UUID=<UUID value> <full-path to the mountpoint> <value of (filesystem) TYPE> auto,exec,users,rw 1 17) Run ‘sudo mount -a’ (mounts all records from ‘/etc/fstab’ except for those containing ‘noauto’).
The selected partition on the drive should be always mounted at the <full-path to the mountpoint> with permissions as set ‘/etc/fstab’.
No need to remount after reboot.- This reply was modified 1 year, 6 months ago by sybok. Reason: Improve code/command emphasizes
October 25, 2021 at 3:26 pm #69531MemberModdIt
Below should work, but is the intent allow all users read write or just you yourself.
Letting all users have full access is a bit iffy security wise.Open a terminal in fullscreen.
Run lsblk to find out where the partition is mounted in the filesystem.
Run: sudo chown $USER:$USER /path/to/mountpoint.
Replace /path/to/mountpoint with the real one.September 10, 2021 at 3:53 pm #66856In reply to: Can’t run most .sh bash scripts from spaceFM
Anonymous
permissions are full rwx-rwx-rwx, owner is root:root
read the manpage for the “chmod” command to learn more about permissions.
Next, read the manpage for the “chown command to understand the “something:something” (x_colon_y)I had the same problems with user:user
Does your system have a login account literally named “user”?
If not, it’s senseless to assign ownership to user:blahblah.
Senseless, but perhaps no harm, because :user ~~ by default, all login accounts are granted membership to the group named “user”rwx-rwx-rwx, owner is root:root
This assignment is seldom advisable. Non-root users should not be granted WRITE permissions for root -owned files, especially not root-owned executable files!
‘command not found’
In which directory do the to-be-executed scriptfiles reside?
Unless that directory is enumerated within your $PATH ( ref: ~/.profile ) …a shell interpreter will be blind to any commands within that directory.example scenario:
staring at a terminal command prompt “$/home/demo:”
If I have created a script “/home/demo/happy.sh” and have set it executable “chmod +x /home/demo/happy.sh”
The shell interpreter [probably] will be able to find/recognize and execute my script if I simply type “happy.sh” then press Enter.
However, if I “cd ~/Downloads” (or elsewhere)… as soon as the script’s parent directory is no longer the CWD (current working directory) of the shell interpreter… yes, typing just “happy.sh” would result in “command not found”it will not open a Terminal window at all with execute
WHAT will not open a terminal window? Are you referring to a “launched from file manager” operation?
If so, why do you expect a terminal window to open? I would expect the file manager will [by default] simply pass the call to the assigned shell interpreter, which in turn, will execute the script in a non-interactive shell. Consider: maybe “Run in terminal” (not “Execute”) — along with ensuring your scripts reside within a $PATH directory — would suit your expectation here.September 7, 2021 at 4:24 am #66602In reply to: Cannot mount any CD/DVDs, only as root
Member
sybok
Hi,
the excerpt from ‘/etc/fstab’ makes it much more clear.
I would probably create a new folder and set it as a new mount-point for ‘/dev/sr1’ instead of the current one, e.g.
1) Folder
sudo mkdir -p /media/ext_multi_drive
May require to set appropriate rights to the folder (via chown/chgrp/chmod) to be the same as the other folders.
2) Manually edit the ‘/etc/fstab/’ so that the last line shown in your post would read
/dev/sr1 /media/ext_multi_drive auto noauto,users,exec,ro 0 0
3) Then reboot and try it.
(Reboot may not be required if some other appropriate action is taken so that the system is made aware of the new ‘/etc/fstab’)PS:
It would also be possible to edit sudoers file to allow you to run specific mount operations, for other devices/partitions, without requiring elevated permission(s).
I did that for a shared notebook for others to mount ‘/data/’ partition in a read-only mode.
Hence I have a growing list of TODO after a (fresh/new) system (re)install.EDIT: I read the other thread/post mentioned; since you seem to boot from live CD, this gets things complicated and my advice does most likely not apply. 🙁
- This reply was modified 1 year, 8 months ago by sybok.
- This reply was modified 1 year, 8 months ago by sybok.
June 24, 2021 at 6:49 am #62233In reply to: Where is antiX 21 core and base betas?
Member
sybok
Hi, not quite sure what does ‘convert’ mean in your post.
It should be possible to
1) Reinstall with ‘core’ while preserving /home if on a separate partition
Not quite sure how user permissions are handled if ones re-create the same user (I haven’t tried it in antiX and it didn’t work well in other Linux-OS I have used in the past); additional
sudo chown <username> -R /home/<username> && sudo chgrp <username> -R /home/<username>
might be needed after that.
2) Get list of installed packages in both ISOs (‘full’ and ‘core’) and attempt to remove everything not present in ‘core’.Personally, I find the option 2) a bit more adventurous.
If anything goes wrong, you may always try the option 1).Still, advised to back-up your data (may include /etc/ folder as well), bookmarks and/or whole browser profile etc.
- This reply was modified 1 year, 10 months ago by sybok. Reason: Comment on option 2)
June 21, 2021 at 11:57 pm #62136Membercalciumsodium
Hi,
I would like to report another positive test result for antiX-bullseye-b1-sysvinit with the 5.10.27 kernel.First, a background to understand why I am happy about the result. I have one old desktop that a friend gave me that has an HDMI output. It is an old Dell Studio with a core 2 processor. So it is about 10 years old. The HDMI out will give both great video and audio outputs. The modern TV has the HDMI input. So why not hook up that Dell to the family TV. The family can browse the internet, stream videos, etc., with the high quality of the HDMI. So that is what I did. I had antiX 19 on that Dell. Initially, I get the video to go through the HDMI, but not sound. So I installed pulseaudio and pavucontrol. Pavucontrol has an option called configuration where I can select HDMI sound/surround sound as the output. But I still can’t get the sound to work. I did some searching on the web. Turns out I have to
sudo adduser $<username> audio
every time I start the computer. So I had to figure out a way to automate it. There might be better solutions out there, but the following was what worked for me:1. create script file /home/<username>/hdmi.sh, which contains the line: adduser $<username> audio 2. give root access and make it executable sudo chown root:root /home/<username>/hdmi.sh sudo chmod 700 /home/<username>/hdmi.sh 3. set up sudo to allow hdmi.sh to execute without a password sudo visudo #to open sudo permissions file: sudoers #around line 25, you'll see this line # %sudo ALL=(ALL:ALL) ALL #below that line, insert the following line <username> ALL=(ALL) NOPASSWD: /home/<username>/hdmi.sh #save and exit text editor 4. in startup, add #sudo adduser #<username> audio /home/<username>/hdmi.sh & #pulseaudio pulseaudio &It works, and our family has enjoyed countless hours with that Dell/TV combination.
So, I wanted to see how antiX-bullseye-b1-sysvinit would do on that Dell with respect to the HDMI quality of the video and audio. Using a different hard drive, I did a fresh install of antiX-bullseye-b1-sysvinit with the 5.10.27 kernel. To my surprise, just running pulseaudio is enough for b1-sysvinit to produce the hdmi sound. The hdmi video is a given. I did not have to do any of the fancy script described above to get the sound to work. I just had to install pulseaudio and have it launch in startup. I did not have to use pavucontrol configuration to select the hdmi sound output. b1-sysvinit automatically selects it.
I wanted to report this positive result.
ThanksJune 5, 2021 at 6:43 am #61005In reply to: pkexec or sudo ?
Anonymous
I should be using pkexec
The effect from using sudo will (does) vary across O/Ses.
What the pkexec advocate “knows to be true” may, or may not, be identically applicable on antiX.
Stock antiX.
You are free to administer your system however you choose, editing sudoers policy to suit your needs.gedit
Not a gedit user, so I’ll just advise you to test ~~ test the outcome of using pkexec vs sudo, specific to to gedit.
toward gauging “which end is UP”, here’s a quick demonstration:
$sudo leafpad /tmp/shoe ### now edit and save the file, then exit leafpad. $stat /tmp/shoe | grep Uid ### ^---> note that the created-via-sudo "shoe" file is owned by "root" ### now, take ownership of this file... $sudo chown $USER:$USER /tmp/shoe ### ...and again open the "shoe" file, edit its content, save, exit leafpad. $sudo leafpad /tmp/shoe $stat /tmp/shoe | grep Uid ### ^---> note that an EDITED-via-sudo "shoe" file is (still) owned by $USERwhen you mouse-click on these in the menu, isn’t this the same as
evokinginvoking sudo?When discussing this, to ensure accuracy, we need to be careful, be specfic.
Each time sudo is invoked, the result can vary, depending on with which commandline options are passed
https://manpages.debian.org/testing/sudo/sudo.8.en.htmlsudo -h | -K | -k | -V sudo -v [-AknS] [-g group name | #gid] [-p prompt] [-u user name | #uid] sudo -l[l] [-AknS] [-g group name | #gid] [-p prompt] [-U user name] [-u user name | #uid] [command] sudo [-AbEHnPS] [-C fd] [-g group name | #gid] [-p prompt] [-r role] [-t type] [-u user name | #uid] [VAR=value] -i | -s [command] sudoedit [-AnS] [-C fd] [-g group name | #gid] [-p prompt] [-u user name | #uid] file ...synaptic
gparted
isn’t this the same$locate synaptic.desktop /usr/share/applications/synaptic.desktop $grep Exec= /usr/share/applications/synaptic.desktop Exec=su-to-root -X -c /usr/sbin/synaptic $locate gparted.desktop /usr/share/applications/gparted.desktop /usr/share/applications/antix/gparted.desktop $grep Exec= /usr/share/applications/gparted.desktop Exec=su-to-root -X -c /usr/sbin/gparted %f $grep Exec= /usr/share/applications/antix/gparted.desktop Exec=gksu gparted $which su-to-root /usr/bin/su-to-rootYou can examine the su-to-root (bash script) in a text editor
to confirm what I’m describing here.su-to-root -X
passes the commandstring to the gksu utility.you can use the “debug” option to check what gksu “is doing, behind the scenes”.
Demonstration:
run the terminal commandline “gksu leafpad”
(FWIW, instead of actually launching leafpad here, you can just press escape to cancel.)cmd[0]: /usr/bin/sudo cmd[1]: -H cmd[2]: -S cmd[3]: -p cmd[4]: GNOME_SUDO_PASS cmd[5]: -u cmd[6]: root cmd[7]: --We note that gksu is, essentially, talking to sudo via stdin and asking sudo to preserve $HOME env variable. Whether or not the request to preserve HOME is granted depends on the current sudoers policy on the system.
sudo -H -S -- leafpad -
AuthorSearch Results
Search Results for 'chown'
-
Search Results
-
Done on antiX 21 Runit, sysv should make little difference.
I just tested this step by step, it worked, no warranty as user made system changes could be an issue.
This done on a fresh setup as I had made a frankenX where libs did not match. Live and learn.Install for a Brother MFC device, most steps are also needed for Brother Laser Multi functional devices.
Refer to Brother support for your specific printer model.For my MFC-J6710DW
CRITICAL: PREQUISITES 32 Bit Support. RUNNING CUPS SERVICE
Use Runit service manager, if you are not running the full antiX version ensure cups is installed, set it to run on start.
For 32 bit support:
sudo apt install lib32stdc++6 libc6-i386 lib32gcc-s1Now create the spooler directory:
sudo mkdir -p /var/spool/ Check this has been created, if not make a folder manualy
sudo chown lp:lp /var/spool/lpd
/var/spool/lpd/mfcj6710dw will be created by printer installer Check it is owned by lp:lp and as shown user lp.For debian you must specify the PATH environment variable.
Run the following command using the command line:
export PATH=$PATH:/usr/sbin
Download and run, as root the Brother Printer driver installer script, it is available on the US website.
I needed to enter bash to the rox console before the script would execute, it is written for BASH.
Should you prefer individual debfiles are available on the brother support download pages
Install is easy, enter sudo apt install in console then drag the file icon in to the terminal window,
the full path will be automagicaly setup. For files downloaded to a usb stick I had to copy them in to user download folder.If you use any papersize other than letter, or wish to make changes you can enter your defaults on localhost:631 cups interface
any graphical browser should do.Do a test print, enjoy or fault find, I hope the former.
- This topic was modified 1 year, 5 months ago by ModdIt.
- This topic was modified 1 year, 5 months ago by ModdIt. Reason: Fail due wrong libs
- This topic was modified 1 year, 5 months ago by ModdIt.