date
int64
1,220B
1,719B
question_description
stringlengths
28
29.9k
accepted_answer
stringlengths
12
26.4k
question_title
stringlengths
14
159
1,588,501,819,000
I have multiple CentOS machines on a network and I need to be able to push one script at a time to all of the machines at once. I have looked at something like Atera, but that is for windows, is not free nor open source and it also has way too much functionality. If anyone can please give me a recommendation on what s...
I can recommend Ansible about that. With Ansible developed by Redhat, you can send and configure commands to multiple servers from one place. I can also recommend Terraform. Many practices about both applications are available on the internet pages. You can also check out: Puppet, Chef, Salt.
Remote script for multiple machines
1,588,501,819,000
Is there anything (specifically in linux machines) that can jump from client to server that would have the ability to perform a root-level task, such as stopping a service in an automated manner? (regardless of service) Example: A DHCP server running from dnsmasq on the server side issues an address to a client. The ...
A secure way is to do this through ssh. Create a service-specific user ("dhcpkiller") and a private/public key pair so that the client can run this command: ssh dhcpkiller@dhcpserver pkill dnsmasq This one-line script gets triggered by your dhcp environment, which can happen in various ways, depending on the DHCP sui...
is it possible to have a dhcp client stop the dhcp service of the server after receiving an address?
1,655,792,954,000
I have setup a directory and some files with setfacl. jobq@workstation:~/Pool$ getfacl /etc/jobq getfacl: Removing leading '/' from absolute path names # file: etc/jobq # owner: root # group: jobq user::rwx user:jobq:rw- group::r-x group:jobq:rwx mask::rwx other::r-x jobq@workstation:~/Pool$ sudo getfacl /etc/jobq/lo...
The problem comes from this ACL on /etc/jobq: user:jobq:rw- This means that user jobq can’t “search” the directory, which is what stops ls from showing its contents. To fix this, you need to add the x permission. See Execute vs Read bit. How do directory permissions in Linux work? for details. See also Restrictive "g...
ls throws errors when trying to access directory guarded with ACL
1,655,792,954,000
CentOS release 5.10. getfacl --omit-header Shared/ user::rws user:foo:rw group::rw mask:rw I want to remove user:foo:rw from this entry. setfacl -m user:foo:0 simply removes permissions. getfacl --omit-header Shared/ user::rws user:foo:--- group::rw mask:rw Is this possible?
You need setfacl -x user:foo Shared/ -m just removes the permissions whereas -x removes the user.
Remove User from ACLs for a specific Directory
1,655,792,954,000
I have created a backup-user (let's just call it jeremy) on an Ubuntu-server. Then I've created a backup-dir, containing files from several different servers: /backup | |--server1 | |--daily_backup | |--weekly_backup | |--server2 | |--daily_backup | |--weekly_backup I've then g...
One must remember to create a default mask for all new filesystem objects as well. setfacl -d -m u:jeremy:rwx backup/
Grant access for user to folder (even files created after permission is granted)
1,655,792,954,000
I have a folder /stuff that is owned by root:stuff with setgid set so all new folders' have group set to stuff. I want it so: New files have rw-rw----: User: read and write Group: read and write Other: none New folders have rwxrwx---: User: read, write, and execute Group: read, write, and execute Other: none I...
There is no way to differentiate between files and directories using setfacl only. Instead you can workaround the issue with using inotify-tools to detect new created files/dirs, then apply the correct ACLs for each one recursively: 1- You have to install inotify-tools package first. 2- Recover the default /stuff dire...
How do I set different default permissions for files vs folders using setfacl?
1,655,792,954,000
With root-user, I've executed this command: setfacl -R -d -m u:MYUSER:rwx /myfolder When I then change to that user ( su MYUSER ) and try to remove a file ( rm /myfolder/somefile.sql then I get the this error: rm: cannot remove 'somefile.sql': Permission denied I can't mv it either; then I get this error: mv: cannot...
MYUSER is a default owner, but not an effective owner. You need to run both setfacl -R -d -m u:MYUSER:rwx /myfolder setfacl -R -m u:MYUSER:rwx /myfolder note second command do not have a default (-d/--default) flag. this sould result in getfacl giving # file: /myfolder/ # owner: root # group: root user::rwx user:...
Unable to remove or change files after setfacl rwx-command
1,655,792,954,000
I have a group called webdev and I want only the root and the memebers of the group webdev to have write access on the directory /web. Now, Here's the problem: # chmod -R u=rwX,go=rX /web # ls -l /web total 4 -rw-r--r--. 1 root root 165 Mar 8 12:29 index.html # ls -ld /web drwxr-xr-x. 2 root root 24 Mar 8 12:34 /web...
ls -ld shows that my folder is now writable for group root. Wrong. It shows, with the + symbol in that position, that the file has ACLs. Since the file has ACLs, the meaning of the middle three permissions letters displayed by ls is the mask, not the file-group permissions. Further reading View extended ACL for ...
How to stop setfacl from making my directory writable for group?
1,655,792,954,000
I have the following code in a bash file: sudo setfacl -m g:jobq:x /usr/local/sbin/jobq_submit sudo setfacl -m g:jobq:x /usr/local/sbin/jobq_server sudo setfacl -m g:jobq:x /usr/local/sbin/jobq_server_stop sudo setfacl -m g:jobq:x /usr/local/sbin/jobq_server_start sudo setfacl -m g:jobq:x /usr/local/sbin/jobq_status s...
setfacl -x only takes a reference to the ACL to remove, not the permissions associated with the ACL: sudo setfacl -x g:jobq /usr/local/sbin/jobq_submit
setfacl -m works but setfacl -x does not work
1,655,792,954,000
I want on a dir,a default mask of --- for others on linux setfacl -d -m o:--- coldir/ works fine On Freebsd 11.0,with ufs2 setfacl -d -m other:--- coldir/ setfacl: other:---: Invalid argument setfacl -m m::others:--- coldir/ setfacl: malformed ACL: invalid "tag" field setfacl: m::others:---: Invalid argument How ...
Solution found,syntax was a little different sudo setfacl -d -m u::rwx,g::rwx,o::,mask::rwx coldir/ So new dir created are 770,perfect for collaborative dir.
Freebsd setfacl
1,655,792,954,000
I would like to restrict a user (user sftp-user, group webgroup) to sftp access for the /var/www/html directory in CentOS 8. They should have read and write permissions so they can make changes to website files. I am able to successfully jail the user to their homedir with ChrootDirectory %h but I can't quite get it t...
I got this figured out. It looks like I was conflating different factors. Trying to work with sftp and ACL at the same time caused me to misdiagnose the problem. All credit to Ulrich Schwarz for essentially solving the problem. To make it work, I had to make sure every directory in the path /var/www/html was owned by ...
How do I jail a user in /var/www/html?
1,655,792,954,000
I have a program on Ubuntu Linux that creates a logs/error.log file with a permissions 660 (rw-rw----) or 640 (rw-r-----). But I want the file permissions always to be 666 (rw-rw-rw-) (including when the program creates the file). Restrictions: I can't modify the program. Therefore, I can't change 660 mode using by t...
You can use inotify to track your file or directory where it is created so you can update its permissions when it is created
How to force set (not subtract) permissions to future files?
1,655,792,954,000
I have a user user1 that has a bunch of folders in their home directory, including /home/user1/data/special/files. I have another user user2. I want: user2 to be able to read/write files/folders in /home/user1/data/special/files user2 to be able to ls: / and see /home /home and see /home/user1 /home/user1 and see /h...
It's possible. chown -R user1:user1 /home/user1 This step will make you the owner of /home/user1 and all underlying directories. chmod 755 /home/user1 chmod 700 /home/user1/data chmod 700 /home/user1/data/special chmod 700 /home/user1/data/special/files And this sets the necessary permission, 755 means the user has ...
How can I give another user read/write access to a specific sub folder and the ability to ls the tree but only for the folder they have access to?
1,655,792,954,000
I have a NAS with a directory for each member of my house. My user name, is member of each member's group. So I have access to folders of all users. I want, when I place a file, inside a user's directory, the file take the ownership from parent directory. Or get specific permissions. Directory of my wife is "zoe_folde...
I think what you are looking for, is to: Use a setgid on each user's directory, so that each new file in that directory will have the same group as the directory; and Set your system's umask to 0002, as it appears to be 0022. umask removes existing permissions from the default permissions, which is 0777 for directori...
Change owner to a file when saved in a specific folder
1,655,792,954,000
I want to change the ACL and the default ACL for all directories and files in a base directory. In other answers (such as this one), the -R flag is used. However, I get $ setfacl -R -m u::rwx my_dir/ setfacl: unknown option -- R Try `setfacl --help' for more information. # this is different from what's done on, e.g. ...
To repeat the command for any file and directory contained in a directory you can use find and its -exec option find my_dir -exec setfacl -m u::rwx {} \;
setfacl -R doesn't work on Cygwin
1,655,792,954,000
I ran sudo setfacl -d -m g::rwx /tmp then went into /tmp and created a file and looked at its permissions: -rw-rw-rw-. 1 jm wheel 0 Aug 24 10:26 test_file then I ran sudo chmod g+rwx test_file and looked at the permissions: -rwxrwxrwx. 1 jm wheel 0 Aug 24 10:26 test_file shouldn't the first command s...
why did I have to run chmod to get them? Because you are doing it wrong! Try: setfacl -Rdm g:maulinglawns:rwx tmp/ touch tmp/foo getfacl tmp/foo # file: tmp/foo # owner: maulinglawns # group: maulinglawns user::rw- group::r-x #effective:r-- group:maulinglawns:rwx #effective:rw- mask::rw- other::r-- ...
why doesn't setfacl give executable permission?
1,293,015,404,000
When I want Linux to consider newly created partitions without rebooting, I have several tools available to force a refresh of the kernel "partition cache": partx -va /dev/sdX kpartx -va /dev/sdX hdparm -z /dev/sdX blockdev --rereadpt /dev/sdX sfdisk -R /dev/sdX (deprecated) partprobe /dev/sdX ... I'm not sure about...
BLKRRPART tells the kernel to reread the partition table. man 4 sd With BLKPG you can create, add, delete partitions as you please (from the kernel, not on disk of course). You have to tell the kernel the offset and size of individual partition, which implies that you must have parsed the partition table yourself bef...
Forced reread of partition table: difference between BLKRRPART and BLKPG ioctl? (Linux)
1,293,015,404,000
I want to capture only the disks from lsblk as showing here fd0 also appears in spite its not really disk for use in this case we can just do lsblk | grep disk | grep -v fd0 but maybe we missed some other devices that need to filter them by grep -v what other disk devices that could be appears from lsblk | grep disk a...
If you want only disks identified as SCSI by the device major number 8, without device partitions, you could search on device major rather than the string "disk": lsblk -d | awk '/ 8:/' where the -d (or --no-deps) option indicates to not include device partitions. For reasonably recent linux systems, the simpler lsbl...
lsblk + capture only the disks
1,293,015,404,000
I wanted to convert some logical partitions to extended ones, so I was following this accepted answer. However, at the step of backing up my current partition table, I messed up and typed the following instead of what was written. sfdisk -f /dev/sda > /mnt/parts.txt Which resulted in this: Disk /dev/sda: 30401 cylind...
This is going to be tricky to fix by hand. I hope you haven't modified any more data on this disk, apart from the broken partition table you wrote to it. Using sfdisk, fdisk, etc to create a backup of the partition table is a good idea (when you don't accidentally type the wrong command :) ). But for extra insurance I...
Approximate partition table backup with sfdisk
1,293,015,404,000
# sfdisk /dev/mmcblk0p1 Welcome to sfdisk (util-linux 2.29.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Checking that no-one is using this disk right now ... FAILED This disk is currently in use - repartitioning is probably a bad idea. Umount all...
ioctl(3, BLKRRPART) = -1 EINVAL (Invalid argument) Indeed, if the message was correct, the error code should show EBUSY not EINVAL. You have an "Invalid argument" because you passed /dev/mmcblk0p1. This is a partition. sfdisk edits the table that lists all partitions. You need to pass the whole...
sfdisk - "This disk is currently in use" - but nothing seems to be using it?
1,293,015,404,000
I am trying to understand what I did wrong with the following mount command. Take the following file from here: http://elinux.org/CI20_Distros#Debian_8_2016-02-02_Beta Simply download the img file from here. Then I verified the md5sum is correct per the upstream page: $ md5sum nand_2016_06_02.img 3ad5e53c7ee89322ff8...
Once you have extracted the filesystem you are interested in (using dd), simply adapt the file size (967424*4096=3962568704): $ truncate -s 3962568704 trunc.img And then simply: $ sudo mount -o loop trunc.img /tmp/img/ $ sudo find /tmp/img/ /tmp/img/ /tmp/img/u-boot-spl.bin /tmp/img/u-boot.img /tmp/img/root.ubifs.9 /...
bad geometry: block count 967424 exceeds size of device (415232 blocks)
1,293,015,404,000
I'm studying partitioning under Linux, starting with sfdisk. If I copy a partition table from one drive to another, it'll copy the device UUID and the PTUUIDs for each partition, but if I'm creating a new device, I can specify a UUID for GPT drives, but not MBR drives. This leads me to think that UUIDs and PTUUIDs are...
This leads me to think that UUIDs and PTUUIDs are not necessary for MBR drives. That's mostly correct. PTUUIDs on the partition table itself don't serve any purpose to MBR itself, but it's used by the system. It doesn't have PARTUUIDs on the partitions at all, just their position in the table. And if I need a UUI...
Are UUIDs and PTUUIDs important for MBR disks? If so, how do I create them on my own?
1,293,015,404,000
Say I have a LUKS encrypted USB (full disk). I am looking for a way to hide the fact that it is a LUKS device. Which strategy would you use to hide the fact that my USB is a LUKS device? My approach would be to alter the LUKS header to make the LUKS header unrecognizable (and be able to go back easily). What about exc...
So, without opening the whole topic of deniable encryption (and the cryptsetup FAQ has a section dedicated to that topic too) and since you're asking to simply hide the LUKS device (if that's sufficient), I'd use the luksHeaderBackup and luksHeaderRestore options from cryptsetup(8). Example for an already created LUKS...
Can I hide the fact that my USB is LUKS encryted?
1,293,015,404,000
I am not able to successfully redirect STDOUT+STDERR on commands that operates with disks. Standard redirecting which always works, is somehow now catching the output. Two practical examples: Example 1: # wipefs --all --force /dev/sda >>/var/log/custom.log 2>&1 [ 20.169018 ] sda: sda1 Example 2: # mount --verbose...
This is not output from the command, this is kernel log messages. Since the messages aren't coming from the command, they aren't affected by redirection. Kernel log messages normally go into log files, and important messages are additionally shown on the console. Exactly what “important” and “the console” mean depend ...
Redirecting output from within disk operations does not work
1,293,015,404,000
sfdisk --delete $disk From Ubuntu 18.04 or later works. What is the equivalent command in Ubuntu 16.04 LTS? Ubuntu 16.04 LTS (--delete missing), Ubuntu 18.04 LTS (--delete present)
Solution 1: build and install sfdisk from sources (to be able to use a more recent version) wget https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.35/util-linux-2.35.tar.gz tar -xvf util-linux-2.35.tar.gz cd cd util-linux-2.35 ./configure make make install /usr/local/bin/sfdisk --delete $disk Solution 2...
Missing argument option in sfdisk?
1,293,015,404,000
I'm creating an image in memory (/tmp is a tmpfs): $ dd if=/dev/zero of=/tmp/sdcard.img bs=512 count=3147775 It's supposed to hold a partition table and the first 3 partitions of a device $ losetup /dev/loop0 /tmp/sdcard.img $ dd if=bootloader.img of=/dev/loop0 bs=512 The first 2048 sectors contain a partition table...
You can make a file as big or as small as you want - especially on a linux tmpfs. df -h /tmp Filesystem Size Used Avail Use% Mounted on tmpfs 12G 472K 12G 1% /tmp We can just make a sparse file. for cmd in \ 'dd bs=1024k seek=20k of=' \ 'ls -slh ' do eval "$cmd/tmp/file" ...
How can I manipulate a partition table file without fdisk checking the validity of it?
1,293,015,404,000
we can print all disks by the following ( on our RHEL machine ) fdisk -lu | grep "Disk /dev" Disk /dev/sda: 247.0 GB, 246960619520 bytes, 482344960 sectors Disk /dev/sdb: 4294 MB, 4294967296 bytes, 8388608 sectors Disk /dev/sdc: 4294 MB, 4294967296 bytes, 8388608 sectors Disk /dev/sdd: 4294 MB, 4294967296 bytes, 83886...
From fdisk man page: In the case the size is specified in bytes than the number may be followed by the multiplicative suffixes KiB=1024, MiB=1024*1024, and so on for GiB, TiB, PiB, EiB, ZiB and YiB. The "iB" is optional, e.g., "K" has the same meaning as "KiB". For backward compatibility fdisk also accepts the suffix...
fdisk or sfdisk + how to show the disks size in GIB and not in GB
1,293,015,404,000
When I run sfdisk -l on my Ubuntu 14.04 machine, it returns the following: Disk /dev/xvda: 36473 cylinders, 255 heads, 63 sectors/track Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/xvda1 0+ 522 523- 420096...
This disk appears to use the traditional PC partitioning type, also known as MBR. In the MBR format, there are exactly four primary partitions, no more, no less: the partition table in the first sector of the disk has four entries. An entry can be marked with type 0, meaning unused. fdisk -l (like many other tools) om...
sfdisk lists an unknown device /dev/xvda4
1,293,015,404,000
partx fails to read the partition table of /dev/sdb on this system. Why does it return this 'failed to read partition table' shown below, instead of null/empty ? Will this 'failed' result always mean the device's partition table is damaged? Notes: here the sdb can work fine as LVM without any partition! # pvs ...
partx requires a partition table. The results posted show there is no partition table on sdb. This is different from a disk which has a partition table, but no partitions. In that case, you could not have an LVM PV on that disk. Compare the output of blkid -o export /dev/sda blkid -o export /dev/sda3 blkid -o expor...
Why partx can't read the partition table of some disks
1,293,015,404,000
I've picked up an HP SimpleSave sd500a backup drive. This is a 2.5", 500GB drive. It has a mysterious CD-like partition, but otherwise seems to contain a WD Scorpio Blue disk. It seems that the CD-like partition is implemented in the enclosure's firmware, but I've no way to be certain of this. I'm repartitioning th...
cfdisk reads the partition table of the device at startup, it will exit if the geometry of a partition is wrong. You can force cfdisk to not read the existing partition table by adding -z: cfdisk -z /dev/sdb This is a cfdisk specific behavior, fdisk will show a similar error but won't exit. The stability of the drive...
Errors from cfdisk with new external USB backup drive
1,293,015,404,000
I use msdos partition table, so there is no PARTUUID supported (it's only on GPT partition tables) root@xenial:~# fdisk -l Disk /dev/sda: 200 GiB, 214748364800 bytes, 419430400 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 51...
Looks like the PARTUUID on a MBR-partitioned disk is the Windows Disk Signature from the MBR block (8 hex digits) + a dash + a two-digit partition number. The Windows Disk Signature is stored in locations 0x1B8..0x1BB in the first block of the disk (the MBR block), in little-endian byte order. This command will displa...
What is PARTUUID from blkid when using msdos partition table?
1,293,015,404,000
I'm testing a Python script intended for use on Raspberry Pi systems for reformatting and copying partition info and partition data. To get the information from the first device (often a USB memory stick), I use: sfdisk -d /dev/sda >sda_data.txt Then, to copy the same table to the destination drive, I use: sfdisk /de...
The dump option is more suitable to exactly replicate a given partitioning. I can't tell you how reliable it is to use sfdisk with a recipe where the partitioning does not match the device size. But you can easily create a more lenient sfdisk script either from scratch or based on a dump. For example if I got the foll...
Copying a partition table with sfdisk from a larger device to a smaller one
1,293,015,404,000
I have some disk image, taken with dd if=/dev/somedevice of=filename.img. I was able to shrink them following this tutorial. Now I would like to script all the procedure, and I managed to perform almost everything, apart the fdisk resize part. I'm trying to resize the partition with this command echo " , +7506944K," |...
I understood what was wrong: First, sfdisk accept the size of the partition, not the increment, so the + sign is wrong. One difference from fdisk is that the end is the sector number from the beginning of the partition, not from the beginning of the device. Then the unit cannot be other than sectors. So in my case, ...
Scripting the partition shrinking
1,293,015,404,000
I have a ssd(256 Gb), when I'm trying to part it: sfdisk /dev/sda << EOF 2048,8388608,S ,104857600,L ,,E ,20971520,L ,20971520,L ,20971520,L ,,L EOF fi the output is: Disk /dev/sda: 238.5GiB, 256060514304 bytes, 500118192 sectors Disklabel type: dos Disk identifier: 0xdedcd8ac Device Boot Start End ...
Partition 3 is an extended partition and shows its size as sum of parts 5, 6, 7, 8.
sfdisk strange behavior: total size of partitions greater than device size
1,293,015,404,000
I dumped the partition layout of a disk, with: sfdisk -d /dev/sda > part_table cat part_table output label: dos label-id: 0x0004bc49 device: /dev/sda unit: sectors /dev/sda1 : start= 2048, size= 131072, type=83 /dev/sda2 : start= 133120, size= 131072, type=83 /dev/sda3 : start= 264192, siz...
You can use the sfdisk output to create the new partition table sfdisk /dev/ram <part_table If you're really daring (or old-fashioned), you can also use dd dd if=/dev/sda of=/tmp/sda-mbr.bin bs=512 count=1 dd if=sda-mbr.bin of=/dev/ram0 bs=1 count=64 skip=446 seek=446
Is there a way to import a layout with multiple partitions into ramdisk?
1,293,015,404,000
We are using a Python script for running sfdisk creating partitions on our Linux. The code is as below: stdin,stdout=\ (lambda x:(x.stdin,x.stdout))\ (subprocess.Popen( ["/sbin/sfdisk","-uM","--no-reread",device], stdin=subprocess.PIPE, stdout=subprocess.PI...
Note, you have a slightly out-of-date sfdisk command, as since 2015 version 2.26 it no longer accepts -uM, which is used to set the default "unit". The difference you are seeing is due to whether numbers are given in MB i.e. Megabytes (1000*1000) or MiB i.e. Mebibytes (1024*1024). 100MB is approximately 95MiB. If you...
how mapping of sfdisk partition size is working
1,293,015,404,000
I just used sfdisk to clone my partition table to a new disk, sudo sfdisk -d /dev/nvme0n1 > /tmp/part.txt sudo sfdisk /dev/nvme1n1 < /tmp/part.txt However, now both drives have the same uuid. How can I fix that and generate a new UUID for device with the cloned partition table? The number that are duped can be seen...
The device identifier UUID I was able to change the UUID of disk with sfdisk, sudo sfdisk --disk-id /dev/nvme1n1 $(uuidgen) Disk identifier changed from 523436E9-4DA5-474F-87CA-D784E4BF345D to E15A552B-CD07-4332-B73C-E67765D11F4E. The partition table has been altered. Calling ioctl() to re-read partition table. Synci...
How can you give a disk and a new UUID?
1,293,015,404,000
I have custom LFS installer which contains sfdisk, I am trying to add support for NVME disks on it. When I make partitions with sfdisk on a normal SATA disk, things go as expected but when I do the exact same on a NVME disk, it creates the partitions, but when I am trying to get the size of a partition (with the sfdis...
I managed to find a sollution so I am adding the answer here so it might help others in case they encountered a similar problem. I used the blockdev --rereadpt /dev/nvme0n1 command. This rereads the partition table, and now I can execute the sfdisk -s /dev/nvme0n1p2 command with no issues without the need of a reboot...
Sfdisk NVME issue, No such device or address
1,402,969,883,000
I'm trying to control a python based program (which doesn't detach itself from console) #!/bin/bash user=nobody pid=/var/run/xx.pid name=xx prog=/xx.py case $1 in start) /sbin/start-stop-daemon --start -b --oknodo --user "$user" --name "$name" --pidfile "$pid" --startas "$prog" --chuid nobody -- --daemon...
start-stop-daemon --start --pidfile "$pid" doesn't write to the pid file unless --make-pidfile (-m) is specified. Without --make-pidfile it is up to the program being launched to create it. Also for --make-pidfile to work, the process being launched can't daemonize itself (via a fork), as then start-stop-daemon won't ...
start-stop-daemon not working as expected, no pid file was written
1,402,969,883,000
I'm learning how to create services with systemd. I get this error: .service: Start request repeated too quickly. I can't start the service any more; it was working yesterday. What am I doing wrong? (root@Kundrum)-(11:03:19)-(~) $nano /lib/systemd/system/swatchWATCH.service 1 [Unit] 2 Description=Monitor Logfiles a...
First, if this is a custom service, it belongs in /etc/systemd/system. /lib/systemd is intended for package-provided files. Second, the service is likely crashing and systemd is attempted to restart it repeatedly, so you need to figure out why it's crashing. Check the service logs with: journalctl -e -u swatchWATCH I...
How to fix ".service: Start request repeated too quickly." on custom service?
1,402,969,883,000
When I type sudo service networking restart, I am getting error as shown below: edward@computer:~$ sudo service networking restart stop: Job failed while stopping start: Job is already running: networking Got this error when I wanted to restart networking after changing mac address and also after setting static IP in...
The error (post-stop) in your log seems related to this (in /etc/init/networking.conf line 25ff.): post-stop script if [ -z "$UPSTART_STOP_EVENTS" ]; then echo "Stopping or restarting the networking job is not supported." echo "Use ifdown & ifup to reconfigure desired interface." exit 100 ...
unable to restart networking daemon
1,402,969,883,000
I am trying to run Google AppEngine on my Debian machine, I created a file init.d/gae: . /lib/lsb/init-functions # # Initialize variables # name=gae user=$name pid=/var/run/$name.pid prog="python /opt/google_appengine/dev_appserver.py --host=0.0.0.0 --admin_host=0.0.0.0 --php_executable_path=/usr/bin/php-cgi /var/w...
You have two problems I can see: prog=python /opt/google_appengine/dev_appserver.py --host=0.0.0.0 --admin_host=0.0.0.0 --php_executable_path=/usr/bin/php-cgi /var/www Will start /opt/google_appengine/dev_appserver.py with prog=python in the environment. This is before your start block, so start-stop-daemon isn't e...
start-stop-daemon won't start my Python script as service
1,402,969,883,000
I'm trying to recover from a faulty installation, and want to remove some packages. But I can't. # apt autoremove offending-package dpkg: warning: 'start-stop-daemon' not found in PATH or not executable (My PATH is fine.) According to packages.debian.org, start-stop-daemon should be in /sbin/. It isn't there! What s...
Another way to do this is first create a dummy /usr/local/sbin/start-stop-daemon that does nothing:#!/bin/sh exec true then simply reinstall the dpkg package:aptitude reinstall dpkg then (of course) remove the dummy /usr/local/sbin/start-stop-daemon. Installing the dpkg package does not in fact require start-stop-daem...
Debian Stretch - where did start-stop-daemon go, and how do I get it back?
1,402,969,883,000
I'm writing a daemon to manage my Java app on a headless Ubuntu 16.04 box using jsvc and this (probably pre-systemd) tutorial, and got as far as running update-rc.d mydaemon enable, receiving the error update-rc.d: error: mydaemon Default-Start contains no runlevels, aborting Having Googled around a bit this appears ...
I don't have a Ubuntu 16.04 to test this on, or provide you with many details, but systemd has a compatibility feature to allow older /etc/init.d scripts to continue working. Instead of using update-rc.d to enable your daemon, use the systemd native command equivalent: sudo systemctl enable mydaemon If this still pro...
Set daemon to start at boot with systemd
1,402,969,883,000
I run Debian 8 jessie. I have activated a daemon's debugging facility, which causes the daemon to print debugging info to stdout and/or stderr. How can I persuade start-stop-daemon(8), as invoked by /lib/lsb/init-functions, to redirect the daemon's stdout and stderr to my debugging log file /root/log? It appears that ...
Trying to pass magic options through the various layers of shell scripting is entirely the wrong way to go about this on a systemd Linux operating system. systemd already logs the standard outputs/errors of services that are auto-generated by the "sysv" service generator, as this one is. The "sysv" service generator ...
How to redirect a daemon's stdout and stderr using start-stop-daemon(8)?
1,402,969,883,000
Here is a piece of my SysVinit file. NAME="flask-daemon" PIDFILE="/var/run/"$NAME".pid" DAEMON="/home/ubuntu/flask/run.py" DAEMON_USER=root f_start() { echo -e "\nStarting : $NAME" start-stop-daemon --start --background --pidfile $PIDFILE --make-pidfile --user $DAEMON_USER --exec $DAEMON } Does anyone knows ...
Guessing you're daemon is running in daemon mode, so it's creating a copy of itself when it starts. I think that might be what the "l" part of "Sl" means in the STAT column of your ps output. I've been use python-daemon quite a bit recently and if that's what your script is using, you can tell it whether to detach ...
Why "start-stop-daemon" spawns two processes?
1,402,969,883,000
On Ubuntu >=12.04, what is the most correct/prettiest way to get rngd to run in multiple instances using an init script? The current one only accepts one random source, so multiple instances are needed. I.e. I would like rngd to be controlled with the "service" command. When I manually start rngd, it works as I hoped ...
You can try to write an Upstart job using instances (the device file would be the instance), then another job that starts all the instances you want at boot. http://upstart.ubuntu.com/cookbook/#instance It would be easier for you if you made the pidfiles based on the device name, so it would be something like "rngd-in...
rngd - multiple instances from init script
1,402,969,883,000
I have a bunch of redis service instances, and I would like to add a label to them in the output of the ps command. Currently I see: $ ps aux | grep redis root <snipped> /usr/local/bin/redis-server *:6381 root <snipped> /usr/local/bin/redis-server *:6380 Is there a way to have an out...
Assuming redis-server does not have built-in support for changing its own command name after startup (some programs, especially daemons, do have such support), there are a few things you can do: Use an alternate command name. Although the first argument in the command line (argv[0]) is normally the name of the binary...
Adding a label to start-stop-daemon service in process list
1,402,969,883,000
I entered sudo shutdown -h now to shutdown my computer. Then, the "A stop job is running..." message appeared. I wanted to abort my shutdown and go back to appropriately closing the running programs... but I couldn't find a way to cancel my shutdown so all I could do was wait for the shutdown to continue. Most of the ...
that "a stop job is running" is visible when you're already pretty much at the end of what systemd could shutdown so far. At this point, you're not able to have an interactive session anymore; you'd need to "boot back" up to the multiuser target. That's technically not possible, and it would also not allow you to save...
How can I cancel (abort) a shutdown when I see "A stop job is running..."?
1,402,969,883,000
I am trying to get an init script running that starts nodejs as a daemon. The problem is, that when I executing start-stop-daemon it always returns '0', regardless of what error the nodejs-daemon may return. I got as far as figuring out that the issue arises when using start-stop-daemon with the --background switch. W...
This is documented behavior. The foreground process completes after forking the background process. From the man page: -b, --background Typically used with programs that don't detach on their own. This option will force start-stop-daemon to fork before starting the process, and force it into t...
start-stop-daemon always returns '0' although the process fails
1,402,969,883,000
I have set up start-stop-daemon to start my script automatically case "$1" in start) log_begin_msg "starting foo" start-stop-daemon --start --chuid nobody --user nobody --pidfile \ /tmp/foo.pid --startas /usr/local/bin/foo.sh & log_end_msg $? the problem is, it always returns 0 (success),ev...
You are not capturing return code of start-stop-daemon. Your problem is that you are launching it in the background and it is started properly. I mean that you are capturing return code of starting something in background that wants to start something in background. Try this: rm /tmp/not_existent_file & echo $? This ...
start-stop-daemon returning always 0 (success)
1,402,969,883,000
I have the init.d script show below. I want to start the daemon with the argument --http_root /tv When I start the application without the daemon the argument is accepted However I cannot seem to figure out how to adjust the script below to start the daemon with that argument. I want the argument to be passed every ...
If you don't want to modify the init.d script, change (or create) /etc/default/tvheadend as steeldriver pointed out in his comment, edit (add, extend) the entry: TVH_HTTP_ROOT=/tv This file gets sourced in the init.d script, with this line: [ -r /etc/default/$NAME ] && . /etc/default/$NAME and then [ -z "$TVH_HTTP...
Passing variable in init.d script
1,402,969,883,000
I have a task to design a service out of a bash script in order to be called in the way service ... start/stop/restart. The script that is to become a service is a infinite while loop which wakes up every minute and does some checking. I call it like this: start() { echo -n $"Starting $DESC:" DAEMON_ARGS=$(xmlstarlet ...
For a start, use the --background switch so it is forked. use the -m switch to create a PID file start-stop-daemon --start --background -m --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_ARGS For a copmplete answer, see https://stackoverflow.com/questions/16139940/what-is-start-stop-daemon-in-linux-scripting Enjoy
start-stop-daemon blocks for process with infinite loop
1,402,969,883,000
How am I supposed to do this in systemd? start unit.A started unit.A start unit.B started unit.B stop unit.A stopped unit.A stop unit.B stopped unit.B I know After=/Before= will order units in reverse on start/stop like AB -> BA, but I need AB -> AB. My guess is, that I have to merge unit.A with unit.B, somethi...
I ended up with this: thisunit_ExecStartPost.sh: systemctl start otherunit thisunit_ExecStop.sh: systemctl stop otherunit In my case, otherunit notices if thisunit fails, otherwise stopping otherunit may need to be moved to thisunit_ExecStopPost.sh, which is generally a better place (but not in my project).
Start and stop systemd units in the same order
1,402,969,883,000
vim /home/mytest.sh rm -f /home/mytest/* I want to write a service to execute the remove action. My expections: sudo systemctl stop mytest can delete files in /home/mytest sudo systemctl start mytest do nothing. Edit my service file. sudo vim /etc/systemd/system/mytest.service [Unit] Description=delete file [Servi...
This is explained in detail in the systemd service documentation, but you pretty much need to read all of it to understand what’s going on. The most pertinent part in this case is example 3; from that, the reader can gather that a oneshot service as you’ve declared it never becomes active, so its stop action will be r...
Why `systemctl stop service` can't invoke the service?
1,402,969,883,000
I want to turn on / enable the auditd daemon to record system events in Slackware 14.2. I could not see the daemon auditd, when I run the code below: ls /etc/rc*.d | grep "auditd" It means it was not existing. How will I enable auditd in Slackware? I know how to start, stop and restart services but if it is not exist...
The distribution does not provide auditd, but one can find the build script SlackBuild. (The URLs will change in the future.) Create a working directory and acquire the required files. mkdir /usr/local/src/audit && cd /usr/local/src/audit wget http://people.redhat.com/sgrubb/audit/audit-2.3.6.tar.gz wget https://slack...
Slackware 14.2 - Turn on the auditd daemon
1,402,969,883,000
I have a bash script that is written in a debian-based distribution (System-V) and I want to run it under CentOS 7. There is a part of the script that runs a command as a daemon like this: start-stop-daemon --start --pidfile $PIDFILE \ --chdir "$DIR" --startas $PROGRAM --name foo --chuid "$USER" -- $ARGS And stops t...
The daemon() shell function from /etc/rc.d/init.d/functions on RHEL/CentOS 6 is not an exact equivalent of Debian's start-stop-daemon. The fact that all of these van Smoorenburg rc tool libraries have subtly different helper command sets is one of the well-known problems with van Smoorenburg rc. You're using CentOS 7...
Debian start-stop-daemon equivalent in CentOS
1,402,969,883,000
Trying to stop the transmission daemon on debian 11 gives me: start-stop-daemon --stop --chuid debian-transmission --exec /usr/bin/transmission-daemon -- --config-dir /var/lib/transmission-daemon/info No /usr/bin/transmission-daemon found running; none killed. But I'm pretty sure that's not the case: root@91c79f82a8...
If you ran start-stop-daemon under strace you'll see: readlink("/proc/3130/exe", 0x7ffc68a5f890, 256) = -1 EACCES (Permission denied) numbers can be different but the point is reading exe symlink results in EACCES. Solution is to run docker container with --cap-add=SYS_PTRACE or --privileged option.
start-stop-daemon can't stop the daemon "No $daemon found running; none killed."
1,402,969,883,000
I am currently following a tutorial that teaches how to create a queue in php. An infinite loop was created in a php script. I simplified the code in order to focus on the question at hand: while(1) { echo 'no jobs to do - waiting...', PHP_EOL; sleep(10); } I use PuTTy (with an SSH connection) to co...
Assuming that you didn't install any signal handlers, you can send SIGINT to the process by pressing Ctrl-C if it in the foreground. If it is not in the foreground, you can use pkill -INT -f '^php queuefile.php$'. By default, php will quit on receiving SIGINT. If, for some reason, there is a signal handler installed, ...
Stopping infinit loop from php script run in linux terminal
1,402,969,883,000
When I start a LSBInitScript as a service I get an SSL error because my script uses an SSL certificate to operate. The certificate lies in the same directory as the script itself. Why do I get the error when starting as service but when called in the console I don't? SSL Error when starting the service: ubuntu@ip-0-0-...
Probably there is error during service startup, because you provided relative path to certificate. There should be absolute path to certificate file. When the system starts a service it doesn't change $PWD to the script location. You can copy certificate to /etc/ssl/certs (according to this answer) and change: verify ...
start-stop-daemon Python script as service using SSL
1,662,120,855,000
Say I have a C program main.c that statically links to libmine.a. Statically linking to a library causes library functions to be embedded into the main executable at compile time. If libmine.a were to feature functions that weren't used by main.c, would the compiler (e.g. GCC) discard these functions? This question is...
By default, linkers handle object files as a whole. In your example, the executable will end up containing the code from main.c (main.o), and any object files from libmine.a (which is an archive of object files) required to provide all the functions used by main.c (transitively). So the linker won’t necessarily includ...
Do C compilers discard unused functions when statically linking to .a file?
1,662,120,855,000
What is the purpose of bash-static compared to regular bash? Is it good as a rescue shell or what is it good for?
You are probably referring to the .deb package bash-static which is a statically linked version of bash, which means that it is a stand-alone program that does not depend on anything else (especially libraries) on your disk. I have used it on two different occasions: Installed on servers so that I always have a worki...
What is bash-static used for?
1,662,120,855,000
I installed an application [ e.g. fdisk ]. But it required libraries for execution. I am looking for utility/tool which will help me to create a static binary from already installed binaries. So that I can use it anywhere. The only reliable tools that I found is ErmineLight from here , but this one is share-ware. Is...
If fdisk is just an example and your goal is really to make static executables from dynamic executables, try Elf statifier. There's even a comparison with Ermine (by the Ermine vendor, so caveat (non-)emptor). Note that If you have many executables, their combined size is likely to be more than the combined size of t...
Creating Static Binary
1,662,120,855,000
I'm playing around with chroot environments, and I'd like to have a portable C compiler so that I can easily set up some basic build-tools in each environment without having to move too many libraries around. Gcc seems pretty bloaty for what I want to do, but if it's reasonably easy to build a static gcc I wouldn't mi...
Building a static binary should be as simple as running gcc with -static, or if ld is being called directly use -Bstatic. Try CFLAGS=-static make after running configure. If it fails, the results will be obvious, e.g. rafts of undefined references at link time.
How can I get a static C compiler?
1,662,120,855,000
I have a simple C program. I run: $ gcc Q1.c -Wall -save-temps -o Q1 Then I inspect the executable generated: $ objdump -f Q1 Q1: file format elf32-i386 architecture: i386, flags 0x00000112: EXEC_P, HAS_SYMS, D_PAGED start address 0x080483b0 Then I compile it with static linking: $ gcc Q1.c -Wall -save-temps -s...
The start address is the address of main(), right? Not really: The start of a program isn't really main(). By default, GCC will produce executables whose start address corresponds to the _start symbol. You can see that by doing a objdump --disassemble Q1. Here's the output on a simple program of mine that only does re...
Effect of static and dynamic linking on start address
1,662,120,855,000
I'm not very knowledgeable on this topic, and therefore can't figure out why the following command does not work: $ gfortran -o dsimpletest -O dsimpletest.o ../lib/libdmumps.a \ ../lib/libmumps_common.a -L/usr -lparmetis -lmetis -L../PORD/lib/ \ -lpord -L/home/eiser/src/scotch_5.1.12_esmumps/lib -lptesmumps -lpt...
I was able to solve this with the help of the comments, particular credit to @Mat. Since I wanted to compile the openmpi version, it helped to use mpif90 instead of gfortran, which, on my system, is $ mpif90 --showme /usr/bin/gfortran -I/usr/include -pthread -I/usr/lib/openmpi -L/usr/lib/openmpi -lmpi_f90 -lmpi_f77 ...
Why can't ld find this library?
1,662,120,855,000
I would like to build standalone bash binaries, which would hopefully work on a good portion of the linux distributions out there. Complete coverage is definitely not a goal. How would I approach this? Best-effort suggestions welcome. I understand that each distribution has e.g. unique readline implementations. If it ...
Download the bash-static package from Debian and extract the executable. ar p bash-static_*.deb data.tar.xz | tar -xJ ./bin/bash-static If you want to see how it's done, look in the sources. The build instructions are in debian/rules. There's a lot of expansion going on, so run it: debian/rules static-build I think ...
Build a standalone bash
1,662,120,855,000
I was wondering how prelinking works. If I prelink my whole system and than delete glibc, will the system 'get up' after restart?
Well of course it won't, because you won't have a C library anymore. All prelink does is to try and calculate an optimal load address for each library so that no program will have overlapping libraries, then update the libraries so that they default to loading at that address. Then when a program is run the libraries ...
How does prelink work
1,662,120,855,000
When creating a windows static library, we simply create a .lib file which should be included in the linker path. When creating a windows shared library, along with the .dll, we also a generate a .lib file. This lib file contains the signatures of the API exposed by the library. There are two ways to use this library...
I can't say I understand what a "statically linked dynamic library", nor do I know anything about signatures contained in libraries (sounds interesting though: does this mean the linker is able to check for type mismatches in arguments and return types at link time? ELF definitely does not have such a feature.) so thi...
Types of dynamic linking in Unix/Linux environments
1,662,120,855,000
I'm having trouble trying to build a static binary of ffmpeg - I've got almost the whole build working, with the exception of two libs - libvorbis and libmp3lame. These two libs are failing during ./configure, specifically on undefined functions from the math.h / libm: libvorbis: gcc -L/vol/build/lib -static -static-...
Well, I managed to solve it - googling the mangled symbols such as _ZGVbN2v_cos led me to this patch mentioning vector math, and in combination with ldd's output during dynamic linking mentioning libmvec, I realized that I might have to link that in as well. For libmp3lame, it has to be linked in before libm: gcc -L/v...
Error during static build of libvorbis and libmp3lame
1,662,120,855,000
I'm using Arch Linux and have successfully built https://github.com/JosephP91/curlcpp However, I have no idea how to build the example program. I keep getting fatal error: curl_easy.h: No such file or directory Of course, this is because I don't know how to add it to the library/include path. In the <curlcpp root>/b...
What exact command do you use to build executable of your program? You need to tell g++ about additional directories with project-specific headers and libraries. If you have libcurlcpp.a copied into $proj_home/lib and libcurlcpp.h copied into $proj_home/hdr this will be something like: $ g++ your_program.cpp -Ihdr -...
how to add curlcpp to the library/include path?
1,662,120,855,000
I have a number of legacy codes that need to be compiled with specific (and often conflicting) libraries. To be specific I have a program which can only be compiled with g77 and another program which can only be compiled with gfortran. Let's call the first program makee and the second program UVES_popler. When compili...
Your bash functions should work, but the "usual" way of doing that is to write a wrapper script for each executable, and set anything that needs to be set in there. (You can change the executable name to foo.bin for instance, and call the wrapper script foo to make it easy to call.) For ELF targets (not sure about oth...
How to link different (incompatible) libraries at runtime depending on program?
1,662,120,855,000
I'm having trouble compiling a simple, sample program against glib on Ubunutu. I get these errors. I can get it to compile but not link with the -c flag. Which I believe means I have the glib headers installed, but it's not finding the shared object code. See also the make file below. $> make re gcc -I/usr/includ...
glib is not your problem. This is: re.c:(.text+0xd6): undefined reference to `print_uppercase_words' What it's saying is you're calling a function print_uppercase_words, but it can't find it. And there's a reason. Look very closely. There's a typo: void print_upppercase_words(const gchar *string) After you fix t...
Linker errors when compiling against glib...?
1,662,120,855,000
I don't yet fully understand how segfaults and backtraces work, but I get the impression that if the function at the top of the list references "glib" or "gobject", you have Bad Issues(TM) with libraries that usually shouldn't go wrong. Well, that's what I'm getting here, from two completely different programs. The fi...
I get the impression that if the function at the top of the list references "glib" or "gobject", you have Bad Issues(TM) with libraries that usually shouldn't go wrong. You get the wrong impression, if you mean this indicates the flaw is probably in those libraries. It doesn't mean that; it more likely means that's...
Getting segmentation faults from inside glib and gobject - I THINK I want to build/statically link against an independant version of glib2
1,662,120,855,000
I've got reasons for not wanting to rely on a specific build system. I don't mean to dis anybody's favorite, but I really just want to stick to what comes with the compiler. In this case, GCC. Automake has certain compatibility issues, especially with Windows. <3 GNU make is so limited that it often needs to be supple...
The main entry point is God. Be it a C or C++ source file, it is the center of the application. Only in the same way that nitrogen is the center of a pine tree. It is where everything starts, but there's nothing about C or C++ that makes you put the "center" of your application in main(). A great many C and C++ prog...
Compiling C/C++ code by way of including preprocessor build instructions in an actual C/C++ source file
1,662,120,855,000
I use Ubuntu 18.04. I install libraries using apt, for example: sudo apt install freeglut3-dev Does apt always install dynamic libraries or I can determine if a package contains static or dynamic library ?
By convention: libfoo1 will contain a dynamic library, while libfoo-dev will create the headers and static library. libfoo1 is only runtime dependencies, and dynamic libraries are runtime dependencies. libfoo-dev is a build-dependency, and static libraries are only used during building/linking. If you want to know wha...
apt packages - static vs dynamic libraries
1,662,120,855,000
Is it possible to build a binary with dependent .so files included so that the binary can be built once and used on machines with the same hardware and OS, without them having the .so files? For example, I am building curl with nghttp2. I do ./configure --with-nghttp2=/usr/local Then I ran make. I got the curl bina...
Depend .so files can be in form of shared objects (they are, .so files) or .a files aka static objects. You can rebuild nghttp2 and pass --disable-shared flag to it's configure. Then you can try to reconfigure and rebuild curl as usual. The point is to be sure that you have only static .a object in /usr/local/lib to l...
Building binary with static objects included
1,662,120,855,000
I have successfully developed a graphical Qt 5.15.2 application using Qt Creator with dynamically linked libraries. For various reasons I have determined static linking would be better for my application. I attempted to switch my development environment to use static libraries instead of dynamic. My application built ...
The Qt documentation is rather sparse, but it turns out my .pro file needed the line QTPLUGIN += qlinuxfb. This resolved the error I was getting.
Qt statically linked application error: linuxfb plugin not found by the application
1,550,498,510,000
In the following example: $ ip a | grep scope.global inet 147.202.85.48/24 brd 147.202.85.255 scope global dynamic enp0s3 What does the 'brd' mean?
brd is short for broadcast. 147.202.85.255 is the broadcast address for whatever interface that line belongs to.
meaning of "brd" in output of IP commands
1,550,498,510,000
Let's say I want to create an internal network with 4 subnets. There is no central router or switch. I have a "management subnet" available to link the gateways on all four subnets (192.168.0.0/24). The general diagram would look like this: 10.0.1.0/24 <-> 10.0.2.0/24 <-> 10.0.3.0/24 <-> 10.0.4.0/24 In words, I confi...
Ok, so you have five networks 10.0.1.0/24, 10.0.2.0/24, 10.0.3.0/24, 10.0.4.0/24 and 192.168.0.0/24, and four boxes routing between them. Let's say the routing boxes have addresses 10.0.1.1/192.168.0.1, 10.0.2.1/192.168.0.2, 10.0.3.1/192.168.0.3, and 10.0.4.1/192.168.0.4. You will need to add static routes to the othe...
Routing Between Multiple Subnets
1,550,498,510,000
I want to know if there's a way to check if some subnets are (or not) overlapped with a List of IPs For example, we have this List: 197.26.9.128/25 193.36.81.128/25 194.33.24.0/22 188.115.195.80/28 188.115.195.64/28 185.59.69.96/28 185.59.69.32/27 41.202.219.32/27 41.202.219.128/29 154.70.120.16/28 154.70.120.32/28 15...
Here are a few bits for you. First, a script in Bash, so not very efficient. It doesn't do exactly what you want, because it only checks one pair of subnets and reports the overlap. Below the script a few rough shell commands follow, thought the result is not presented in the form you want. So you need to integrate an...
Check overlapped subnets
1,550,498,510,000
On Ubuntu, I've written some host declaration in each subnet with isc-dhcp-server, and each fixed address for each network interface are successfully leased. There are plugged two network cards on this DHCP server. But how to make corrections for this warning? dhcpd[11328]: WARNING: Host declarations are global. The...
Host definitions are always global. So I have 3 networks on my router; "LAN" 10.0.0.0/24, "guest" 10.100.100.0/24 and "IoT" 10.100.200.0/24 My dhcpd.conf has the following sort of config subnet 10.0.0.0 netmask 255.255.255.0 { authoritative; option routers 10.0.0.1; blah; } subnet 10.100.100.0 netmask 255....
How to declare fixed addresses for each subnet in isc-dhcp-server?
1,550,498,510,000
I currently have my Debian VM using NAT and it is on subnet 10.0.2.x where my host is on 192.168.0.x how can I get my guest on the same subnet as my host? Host: Ethernet adapter VirtualBox Host-Only Network #2: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::b0cd:11de:7c85:f11a%1...
What you describe is the result of having the virtual machine's network adapter in "NAT" mode; in this mode your host machine is acting as a router for your VM. If you want your VM to be on the same IP subnet as the host machine, the interface must be set in "bridged" mode; this allows network traffic to go seamlessly...
Virtual Box guest on different subnet than host
1,550,498,510,000
On a RHEL 7 box whose local IP address is 10.0.0.159, the following command prints out the IP 10.0.0.159: $ echo "$(ifconfig eth0 | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | \ grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1')""(rw,sync)" What would the command have to change to in order to print out `10...
NOTE: ifconfig is a deprecated cmd. your should be using cmds. in the iproute2 package going forward. Below I show how to use ip to accomplish what you want using the replacement tool. Rather than do this with ifconfig I'd recommend using the ip command instead. IP CIDR This form shows the IP address in CIDR notation...
grep for an IP range?
1,550,498,510,000
I have two machines A and B which are in different subnets, both behind separate firewalls. Machine A can see B, but B cannot see A. I have a user account (non-root) on both machines, I can SSH B from A, and I would like to be able to SSH A from B instead, but that cannot be done directly. I have used tunnelling to ...
The short answer is yes you can, the how is: machine-A$ ssh -R 127.0.0.1:2222:127.0.0.1:22 [ip__or_name_of_B] Then on B you can ssh to A with: machine-B$ ssh -p2222 127.0.0.1 This says the following: On A create a tunnel on the remote side (-R), such that any traffic that goes to localhost (127.0.0.1) on port 222...
"Reverse" an SSH connection from destination to target [duplicate]
1,550,498,510,000
I want an unmanned WireGuard client to work with redundant WireGuard servers. Physical: I have a master database server in a VPS of provider A in the USA. I have continuous replication running to a slave server in a VPS of provider B in Europe. I have a backup database server, also running as a replication slave, on ...
This VPN is to access private resources, not a way to access Internet anonymously. So split tunneling should be used. Just replace on the client side: AllowedIPs = 0.0.0.0/0 by only the needed resource: the server running the database. For client's wgEUR.conf: AllowedIPs = 10.20.10.1/32 For client's wgUSA.conf: Al...
How to configure a WireGuard client to interact with two distinct servers?
1,550,498,510,000
I'm building a website on my laptop. To see how it renders, I serve it locally on port 80 with lighttpd. I can then open it in my laptop's browser via any IP or URL referring to the laptop http://localhost or http://192.168.1.47 (IP on the local subnet) or http://coulomb (its hostname) . Fine. Now I want to test its r...
You can't define the WordPress site as "localhost", since then as you've found out it will insist on referencing itself by that name. Instead, use a name that can be resolved on your LAN (if necessary by using the relevant /etc/hosts files, but ideally by using your DNS), and make sure you're listening on the LAN IP a...
Website served on port 80 unreachable from my phone in the local subnet
1,550,498,510,000
I read on a book about networks that class A has 16777214 hosts and 127 subnets,my question is: how they obtain the 127 number?
The A class networks space corresponds to all IP addresses with the first bit set to 0, i.e. IPs from 0.0.0.0 to 127.255.255.255, i.e. the class A subnets from 0.0.0.0/8 to 127.0.0.0/8. Since 0.0.0.0/8 is reserved by the protocol (see RFC1122, section 3.2.1.3 for details) you are left with the subnets from 1.0.0.0/8 t...
Network: how they obtain 127 subnets? [closed]
1,550,498,510,000
I am setting up my dhcp.conf file for my dhcp server. All documentation says you 'can' define subnetworks but I have not seen and example without them. Definitions of a subnetwork say they are a network within a network. My network is only very simple with a hand full of devices connecting to dhcp server, I don't need...
It's just one subnet. Your configuration requires a subnet declaration, even if it's just one network. subnet 10.100.0.0 netmask 255.255.255.0 { option routers 10.100.0.1; option domain-name-servers 10.100.0.1; option domain-name "angelsofclockwork.net"; opti...
Is a subnet required for a dhcp.conf?
1,550,498,510,000
I hope someone can help me. This server issue I have is driving me crazy! So I have the following configuration: INTERNET | +----------------------+ ...
Fixed the issue by adding ‘ up route add -net 192.168.8.0/24 gw 192.168.2.35 dev enp1s0’ to /etc/network/interfaces’ thanks for the time, understand and giving me the directions of learning to add a static route. That did the tric!
Can’t reach the whole subnet
1,550,498,510,000
I having a hard time understanding IP subnetting for /16 mask. I went through some tutorials and understood the host part and non-vlsm but with vlsm and dividing into equal parts, is something I am not sure yet. Especially for the below sample, if someone can help me with the output, I will be able to deduce the expl...
It is impossible to divide 65536 addresses into 5 equal parts, since 65536/5 = 13107.2 and you can't have a "one-fifth address".
IP Subnetting /16 into 5 equal parts [closed]
1,550,498,510,000
I prepared dhcpd configuration in Debian 8 and it successfully worked but then I added bridge and dhcpd failed. bridge: root@remote:/home/s# brctl show bridge name bridge id STP enabled interfaces br0 8000.00224dad5ddf no eth0 eth1 root@remote:/home/s# cat /etc/netw...
Your original DHCP server configuration used eth0. You've now replaced that in your network definitions with br0, so you need to update your DHCP server configuration accordingly.
dhcpd and bridge - No subnet declaration error
1,550,498,510,000
I have an USR-TCP232-S2 IP-to-Serial converter and I would like to access it over Ethernet to set it up. The module comes with a fixed IP address 192.168.0.7. My PC (Lubuntu 18.04) is however on a different subnet (192.168.1.0/24, IP address 192.168.1.80, gateway 192.168.1.235), so I can't talk to the module directly....
It turned out that the module was shipped configured as DHCP instead of Static IP. When I ran nmap -p80 192.168.1.*, it found the module at IP address 192.168.1.11. I was then able to change it to Static IP, with IP address 192.168.0.7. I then couldn't reach the module anymore on IP address 192.168.1.11 and also not o...
Access IP address on different subnet without gateway
1,550,498,510,000
Situation: I have 3 devices on an Ethernet network. 1) 172.30.40.100 (Ubuntu 14.04) 2) 172.30.41.101 (other) 3) 192.168.30.102 (other) I would like to setup 1) to be able to send msgs to both of the devices. I can hear each of the devices emitting UDP traffic (ngrep/tcpdump/Wireshark). There is a UDP protocol msg...
If you are plugged into a non-managed switch or hub, an Ethernet Alias will fix you up. Not sure how to do it in Network Manager (I always remove it anyway, and use the /etc/network/interfaces file) but if you open a terminal you can do sudo ifconfig eth0:1 192.168.30.105 netmask 255.255.255.0 And you should be able...
Is there a way to setup a computer to talk to two different devices on different subnets which are physically connected?
1,550,498,510,000
Thanks for taking a look to my issue and think with me for a solution. I have a samba server on a subnet 172.23.3.55/23 (2.0 --> 3.255) and within that subnet I can access the server no problem. Also the 172.23.4.0/23 subnet that lives on the same Core Switch can access the server no problem. Even our Office Subnet 12...
Nobody supplied an answer, but the problem does not persist anymore.
Samba share not accessable from other subnets
1,550,498,510,000
I am trying to setup a PXE server on my laptop on CentOS 7 to connect to a physical test client, following the tutorial on: https://www.linuxtechi.com/configure-pxe-installation-server-centos-7/#comment-35567 All of the configuration files and setup procedures are from this website. On “Step: 6 Start and enable xinetd...
dhcpd is not detecting any network interface that would be already configured with an IP address in the 172.168.1.0 subnet, and so it cannot figure out which network interface it should use to provide its services. And no, you cannot use the DHCP server you're starting to assign an IP address to the system that is act...
“systemctl start dhcpd.service” command not working for PXE server setup virtual
1,550,498,510,000
I have some CentOS 7 servers hosting VMs. The VMs are connected to a network bridge on their respective hosts that allows them to communicate with each other and with the host (via a dummy adapter on the host). The hosts also each have a physical adapter which allows external communication. The bridges must not be ...
I was able to solve this by creating an overlay network using vxlan. I added a vxlan adapter to each host, and connected the adapters to the bridges on the hosts. One of the hosts serves as a router to connect the vxlan subnet to the rest of the network.
How can I create a virtual subnet that spans multiple servers?
1,550,498,510,000
it might be a dumb question but I'm stuck. I have to subnets on my router 10.0.0.x/24 and 192.168.88.x/24, while ping is working on VM's with 10.0.0.x/24 subnet and they see each other - telnet is adamant in saying that there is no route: [root@centos7 ~]# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue sta...
[Edited for clarity, and addition of information] I believe that DNS uses UDP by preference (or at least it used to... I'm an old-timer). "No route to host" probably indicates that somewhere along the path (which essentially means "on the nameserver" in this case) the traffic to tcp port 53 is being denied by a firew...
OL7: Telnet no route to host
1,550,498,510,000
Right now whenever I connect to a (commercial) VPN server a tun interface spins up with an inet address assigned to it as well as a peer one (whatever that means). root@mininet-vm:/etc/openvpn# ip -4 a show dev tun0 33: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group defau...
If you have no control over the server then you can't do this. The TUN interfaces handles layer three packets (as opposed to a TAP interface, which handles layer two). The server will have static rules for routing and you wont be able to change this using only client side configuration.
OpenVPN configuring client to use subnet topology results in "inet prefix is expected rather than 10.66.10.6/-1"
1,436,514,143,000
I had a tough misleading error while connecting in AWS VPC subnets. The error did occur in B->A connection, and did not happen while A->B, so at the beginning I thought that it is library bug. It happened to be caused by AWS-system "double layer routing, and the NAT instance in the subnet, that did redirect packets o...
On the instances in subnetA (with NAT-instance 172.16.0.200), the routing table looks like: default via 172.16.0.200 dev eth0 172.16.0.0/24 dev eth0 proto kernel scope link src 172.16.0.141 actually, the one addition: $ ip r a 172.16.3.0/24 via 172.16.0.1 (or ip r a 172.16.3.0/16 via 172.16.0.1) Fixes the system ...
AWS VPC NAT | ssh_exchange_identification: read: Connection reset by peer [closed]