The officially official Devuan Forum!

You are not logged in.

#251 Re: DIY » sudo and slim » 2023-01-27 19:30:41

Head_on_a_Stick wrote:
nahkhiirmees wrote:

The livecd i tried is modified devuan chimaera.

Can you be more specific? Looks like you broke it big_smile

I guess i have to upload the .iso image somewhere to be precise enough with what i mean by "modifications".

#252 Re: DIY » sudo and slim » 2023-01-27 19:24:39

I tried with an unmodified devuan chimaera live dvd. I removed devuan from group sudo with usermod. And was able to log in after logging out.
Also removed /etc/sudoers.d/live and logged out. Still was able to log in.

So it seems that the modifications are to blame.

#254 Re: DIY » sudo and slim » 2023-01-27 18:09:48

Head_on_a_Stick wrote:
nahkhiirmees wrote:

So first i thought that i'll remove user "devuan" from group sudo. After that i couldn't log in.

I cannot reproduce that with devuan_chimaera_4.0.2_amd64_desktop-live.iso.

I used

sudo gpasswd -d devuan sudo

Then logged out and was able to log in again via SLiM with no problems.

What were the exact commands you used? Was this with a stock ISO image?

First i used "sudo usermod -G devuan,cdrom,floppy,audio,dip,video,plugdev,netdev devuan" . After that i locked out and i could not back log in as "devuan" .
Also tried commenting out "%sudo    ALL=(ALL:ALL) ALL" in /etc/sudoers . That locked me out too.
The livecd i tried is modified devuan chimaera. I'll soon test an unmodified chimaera dvd too, just in case.

#255 Re: Off-topic » Music » 2023-01-27 17:52:58

nahkhiirmees wrote:

https://www.youtube.com/watch?v=c7kMYeiF5fs Drudkh - A Furrow Cut Short
not so much into Drudkh but this one i like.

This sounds interesting also:

https://www.youtube.com/watch?v=JNWUMsrNp7w Drudkh - U Dakhiv Irzhavim Kolossyu (official premiere)

for some reason guitar parts in the beginning remind me of Megadeth. Maybe same kind of chord progression or something.

#256 Re: Off-topic » What are you reading/want to read ? » 2023-01-27 17:45:52

Liu Cixin:Ball Lightning . I''l strongly recommend. I have been reading books by Alastair Reynolds but L.C is my new favourite now.
Recently i noticed that there's a copy of "linux system programming" in the local library. Maybe i'll read that some day.

#257 DIY » sudo and slim » 2023-01-27 17:40:08

nahkhiirmees
Replies: 32

Thinking aloud:

i'm working on making my own version of Devuan livecd. Remove packages i don't need, add some that i need, change keyboard settings and so on.
One thing is that i don't actually need to run every command with no password as user "devuan". But on the other hand it would be very nice to be able to log in and out of slim. So first i thought that i'll remove user "devuan" from group sudo. After that i couldn't log in.
Removing file "live" under /etc/sudoers.d or removing "@includedir /etc/sudoers.d" from /etc/sudoers on the other hand doesn't seem to restrict superuser-capabilities from devuan.

So how should i approach this thing? Is it absolutely necessary for "devuan" to belong in group "sudo" to be able to log in with slim?

#258 Devuan » what's going on with aufs? » 2023-01-27 17:30:53

nahkhiirmees
Replies: 4

Couple of years ago i found something called "auroot".
Lately i thought that "i'll try it, i may have an use case".
Well:

apt-cache search aufs
bilibop-common - shell functions for bilibop scripts
bilibop-lockfs - lock filesystems and write changes into RAM
mergerfs - another FUSE union filesystem

. So it looks like that i have to use another distribution's repository.
I have been planning to ask from this forum what's going on with aufs and Devuan.
But:

https://aufs.sourceforge.net/

mostly "unsupported since xxx" and "EOL" does not sound good to me. Have anyone tried this "mergerfs"-package? what do you think?

I guess i could use lvm snapshot with chroot but there is some complications with ext3/ext4 and lvm snapshots. Unmounting fs before making snapshot seems to be necessary but not sufficient...

#259 DIY » init script for stubby » 2022-10-24 20:45:01

nahkhiirmees
Replies: 10

Couple months ago i tried dnsmasq and stubby. During that time i noticed that there's no init script for stubby so i wrote one:

#!/bin/sh

### BEGIN INIT INFO
# Provides: stubby
# Required-Start: $network $remote_fs $syslog
# Required-Stop:  $network $remote_fs $syslog
# Default-Start:  2 3 4 5
# Default-Stop:   0 1 6
# Description: a dns resolver
### END INIT INFO

#. /lib/lsb/init-functions

case "$1" in
  start)
	touch /run/stubby.pid
	chmod 600 /run/stubby.pid
	chown stubby:65534 /run/stubby.pid
	sudo -u stubby stubby -g
	;;
 stop)
	killall stubby
        ;;
  *)
        echo "Usage: $SCRIPTNAME start" >&2
        exit 3
        ;;
esac

pretty obvious stuff. The #BEGIN ... #END - parts i copied from dnsmasq's init file or some other file and changed a few rows.
How about adding something like this in the stubby package?

#260 Re: DIY » /etc/network/interfaces vs dhclient -s » 2022-07-29 18:12:07

I know how to use "reject" in dhclient.conf .
When i say "/sbin/ifup eth0" , ifup starts dhclient and that sends DHCPDISCOVER-message to broadcast address.
The "reject" - statement reject responses from unwanted servers.

On the other hand, if dhclient sends DHCPDISCOVER-messages only to a server mentioned in "-s" option , "reject" may not be necessary.

(man page of dhclient says: "  -s server-addr
              Specify  the server IP address or fully qualified domain name to
              use as a destination for DHCP protocol messages before  dhclient
              has  acquired an IP address.  Normally, dhclient transmits these
              messages to 255.255.255.255 (the IP limited broadcast  address)")

That made me think, how can i pass "-s server" to dhclient from ifup? I'm yet to figure out if it is even possible.
Those "up", "pre-up" , "manual" keywords in /etc/network/interfaces seemed interesting. Maybe with those i could gain more control, how i set up network interface.

Command "dhclient -s something" by itself is not enough to activate the interface and associate ip address with it. I have tried.

I don't actually need this thing i'm trying. I just like to find out another way of doing things. (Just using /etc/network/interfaces instead of NetworkManager is not radical enough smile
I have read /usr/share/doc/ifupdown/examples  and it seems that it does not contain exactly the thing i'm after .

#261 Re: Installation » [SOLVED] moving /-partition to LVM after installation (Devuan 4) » 2022-07-28 16:01:46

Maybe that "?id=2323"-link was the "trick" i was looking for last sunday.
I'll have to try those "askubuntu.com" and "ogris.de"- links also. Managed to change the passphrases for partitions by using livecd.

#262 Re: DIY » /etc/network/interfaces vs dhclient -s » 2022-07-28 15:51:58

Ok, i found out that i can alter iptables rules without activating ethernet interface. So chicken-and-egg can be avoided. But i'm not sure that iptables rules i added, are restricting packets from port 67. I'll try again later.

#263 Re: DIY » /etc/network/interfaces vs dhclient -s » 2022-07-27 17:20:25

Is it possible to restrict the target address where dhclient sends DHCPDISCOVER messages?
The output of "/sbin/dhclient --help" and https://linux.die.net/man/5/dhclient-options part "option dhcp-server-identifier ip-address; " make me think it is possible.
Ok i guess i could try with iptables, drop ports 67,68 from all unwanted servers or accept only from the server i want to. But for iptables to work, i have to set up the network interface eth0 , right? Kind of a chicken-and-egg situation.

#264 Re: Installation » [SOLVED] moving /-partition to LVM after installation (Devuan 4) » 2022-07-27 16:01:33

Marjorie wrote:

Just checking.

Can you post the code for your
/etc/fstab,
the primary menuentry from /etc/boot/grub/grub.cfg
the results of sudo blkid
and the results of sudo fdisk -l?

I'm wondering whether with your copying root partition contents around the UUID have got misaligned or you are using the wrong /dev/ (LVM vols. are usually on /dev/mapper/)

During last weekend i tried more than once, to copy the contents of / to a logical volume(with cp -a , one directory at a time). And update initrd and GRUB menu. It is possible that something went wrong while copying or there were wrong UUIDs in grub.cfg for a while.  But that's not the whole story. I noticed that new entries for new root were wrong in a sense that there weren't any lines for loading luks drivers. (Forgot to mention in 1st message that / partition and PV were "inside" luks.)

I suspect that initrd/initramfs doesn't activate LVM for some reason. Since i could make PV and VG and LVs after installation, the lvm2 package should be ok.

#265 Re: Installation » [SOLVED] moving /-partition to LVM after installation (Devuan 4) » 2022-07-27 15:33:24

nahkhiirmees wrote:

I also ran into some problems while trying to provide the error messages and screenshots. The computer, where i tried this thing mentioned earlier it this topic, is an old laptop and there seems to be some kind of hardware problem which prevents me from entering the right passwords/passphrases. If i'm lucky its just the keyboard that is broken.

Maybe i can try to reproduce the situation in my desktop, with a virtual machine.

I thought that it would be easier to reproduce the situation(and take screenshots) in a virtual machine. Not necessarily. Either the installation disk(devuan chimaera live desktop) is scratched or there's a bug in VirtualBox. Managed to take some screenshots from the installation phase but how can i upload those? Or is there any website where i can upload pics without registering?

After installation phase things got complicated. Managed to change /boot partition from non-encrypted to encrypted(tar -c+umount /boot+cryptsetup luksFormat --type luks1+cryptsetup luksOpen+mke2fs+mount+tar -x+nano /etc/default/grub+update-grub+update-initramfs -u). And the virtual machine even booted after that.

Then i remembered, unfortunately,  that i have to re-partition for that encrypted lvm partition. So install again from scratch into pre-existing vhd ... and then there were some previous entries in GRUB menu, none of the entries worked,  new or old. So destroy the vm and create a new one  -> after the installation was done i got into GRUB menu , but after booting the default entry there were complaints about mdadm. Didn't get a chance to give passphrase for / partition. Next try to install and the vm didn't manage to get into GRUB phase.

Enough fighting for one day.

It is propably pointless to use luks on an old laptop which does not even have a working keyboard anymore.

#266 Re: Off-topic » Music » 2022-07-25 16:32:59

https://www.youtube.com/watch?v=c7kMYeiF5fs Drudkh - A Furrow Cut Short
not so much into Drudkh but this one i like.

#267 Re: Installation » [SOLVED] moving /-partition to LVM after installation (Devuan 4) » 2022-07-25 16:18:59

nahkhiirmees wrote:

If i have to guess, i should edit  /etc/initramfs-tools/initramfs.conf or  /etc/initramfs-tools/update-initramfs.conf or write a script under those subdirectories.
But what kind of options or scripts?

https://askubuntu.com/questions/551446/ … -initramfs
https://ogris.de/initramfs.lvm/
maybe something like these are what i'm looking for.

#268 Re: Installation » [SOLVED] moving /-partition to LVM after installation (Devuan 4) » 2022-07-25 16:10:02

Of course i got some things mixed up last night.
The initrd that works, is aware of luks, not volume groups. It asks for passphrase, so after i give it, activating VG myvg should be possible.
So the problem is:how to modify initrd so that it activates myvg?

Ok, this question does not concern installation so much after message #2. Moderators can transfer it to another area.

#269 Re: Installation » [SOLVED] moving /-partition to LVM after installation (Devuan 4) » 2022-07-25 11:22:43

I also ran into some problems while trying to provide the error messages and screenshots. The computer, where i tried this thing mentioned earlier it this topic, is an old laptop and there seems to be some kind of hardware problem which prevents me from entering the right passwords/passphrases. If i'm lucky its just the keyboard that is broken.

Maybe i can try to reproduce the situation in my desktop, with a virtual machine.

#270 Re: Installation » [SOLVED] moving /-partition to LVM after installation (Devuan 4) » 2022-07-25 11:15:59

Re-install seems to be the easy way out of this situation.
But it could also be very useful to know how to alter initrd in a way that enables it to mount root partition that lives on a volume group.
Last night i was too tired to figure out the right search term for Google.

#271 Re: DIY » /etc/network/interfaces vs dhclient -s » 2022-07-25 11:07:23

I tried some commands today:

1.sudo /sbin/ifdown eth0 + unplug the ethernet cable
2. /sbin/ifconfig says:

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets xxx  bytes yyyyyy (yyy.y KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets xxx  bytes zzzzzz (zzz.z KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

3. find dhcp server address from /var/lib/dhcp/dhclient.eth0.leases
3,5. plug ethernet cable back in
4. sudo /sbin/dhclient -s <server_addr> eth0
5. after some waiting, give command /sbin/ifconfig, result:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::<something>  prefixlen 64  scopeid 0x20<link>
        ether <something>  txqueuelen 1000  (Ethernet)
        RX packets xxxxx  bytes xxxxxxxxx (xxx.x MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets yyyyy bytes yyyyyyyy (y.y MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
...

so the dhclient command by itself is not enough unless i want to change to ipv6. But not just yet. Let's make ipv4 work first.
And i guess that "ip" commands in /sbin/dhclient-script are there for a reason. So, what kind of "ip"-command should i use?

#272 Re: DIY » /etc/network/interfaces vs dhclient -s » 2022-07-25 10:46:52

nahkhiirmees wrote:

When i say in /etc/network/interfaces : iface eth0 inet dhcp , command "/sbin/ifup eth0" activates dhclient.
By default, dhclient broadcasts DHCPREQUEST-messages to all hosts.
But what if want to say which server dhclient sends it requests?

Of course i meant DHCPDISCOVER , not DHCPREQUEST.
Maybe i'll try that "server-name" thing but somehow i doubt that's the thing that i'm after.

And from these pages:

https://manpages.org/etc-network-interfaces/5
https://manpages.org/etc-network-interfaces/5

i noticed the "manual" keyworḍ. Combining that with "up" or "pre-up" seems interesting. I could give commands that way. Commands like "dhclient -s"  for example. But do i have to do something to the network interface before invoking dhclient? 
I noticed, from /sbin/dhclient-script that there is this command called "ip". It seems it can do many things. 
Unfortunately i'm not familiar with "ip" command, so some help would be appreciated,

#273 Re: DIY » /etc/network/interfaces vs dhclient -s » 2022-07-24 20:24:34

I'm not exactly sure there's a keyword in dhclient.conf for what i want. server-name "string"; seems closest thing. I guess i can try that (tomorrow).

#274 Installation » [SOLVED] moving /-partition to LVM after installation (Devuan 4) » 2022-07-24 20:11:33

nahkhiirmees
Replies: 13

Years ago, when i was still using Debian, it was possible to install in a way that the /-partition was a logical volume under a volume group.
Lately i switched to Devuan and refractainstaller does not offer that "root on LVM"-option.

So i used a normal partition for / and later moved /home to a volume group that i made after the install.
And then i tried a) to copy contents of /-partition to another logical volume and b) make the boot process use logical volume as root partition(several times).
Part a) was easy:vgchange -a y+lvcreate+mkfs.ext4+cp -a .
But part b) was not. I wonder if it is possible?

In the /boot/grub/grub.cfg there is line "vmlinuz root=/dev/myvg/newroot".
I know that i have to do something to initrd so that it sets up VG myvg before trying to mount the new root partition (/dev/myvg/newroot).
I think initrd is aware of lvm and it sets up myvg for swap and home. But how do i say that "activate myvg earlier, before mounting /" ?

Commands "update-initramfs -u" and "update-grub" haven't done what i wished. The new root mounted or not. Chrooting to new root part and giving the command from there has been done also. Still the new initrd cannot find /dev/myvg/newroot.
If i have to guess, i should edit  /etc/initramfs-tools/initramfs.conf or  /etc/initramfs-tools/update-initramfs.conf or write a script under those subdirectories.
But what kind of options or scripts?

Or is it easier to just re-install and try some kind of trick before refractainstaller installs GRUB?
Right now i'm not using that computer but i can provide the error messages and stuff later,

#275 DIY » /etc/network/interfaces vs dhclient -s » 2022-07-24 19:40:35

nahkhiirmees
Replies: 10

When i say in /etc/network/interfaces : iface eth0 inet dhcp , command "/sbin/ifup eth0" activates dhclient.
By default, dhclient broadcasts DHCPDISCOVER-messages to all hosts(255.255.255.255).
But what if want to say which server dhclient sends it requests?
It is possible to say "reject a.b.c.d/mask" in /etc/dhcp/dhclient.conf but that's not what i mean.

Then i tried /sbin/dhclient --help:

Usage: dhclient [-4|-6] [-SNTPRI1dvrxi] [-nw] [-p <port>] [-D LL|LLT]
                [--dad-wait-time <seconds>] [--prefix-len-hint <length>]
                [--decline-wait-time <seconds>]
                [--address-prefix-len <length>]
                [-s server-addr] [-cf config-file]
                [-df duid-file] [-lf lease-file]
                [-pf pid-file] [--no-pid] [-e VAR=val]
                [-sf script-file] [interface]*
       dhclient {--version|--help|-h}

it seems that "-s" - option is what i want.
But how i should edit /etc/network/interfaces so that "-s server_ip"-option goes to dhclient when i bring eth0 up with /sbin/ifup?
I guess "pre-up <command>" or "up <command>" are the things that i should add to /e/n/interfaces. But exactly what commands?
Should i bring eth0 up with temporary address by using "ip" command? And after that "dhclient -s <server_ip>" ? Or is dhclient enough?
I'm not a completely newbie with computers or linux but haven't tried this kind of thing before.

Board footer

Forum Software