Tag Info

Hot answers tagged

11

The init process is always assigned PID 1. The /proc filesystem provides a way to obtain the path to an executable given a PID. In other words: nathan@nathan-desktop:~$ sudo stat /proc/1/exe File: '/proc/1/exe' -> '/sbin/upstart' As you can see, the init process on my Ubuntu 14.10 box is Upstart. Ubuntu 15.04 uses systemd, so running that command ...


8

On RPM-based systems, you can query the RPM database to see what package provides /sbin/init. For example: fedora:~$ rpm -qf /sbin/init systemd-216-24.fc21.x86_64 centos:~$ rpm -qf /sbin/init upstart-0.6.5-12.el6_4.1.x86_64 opensuse:~$ rpm -qf /sbin/init systemd-sysvinit-44-10.1.1.i586 If you just want the package name, and not version, you could add ...


5

For your -name version, instead of ! -name '*[done]*' you need ! -name '*\[done\]*' - otherwise it's taking the letters in brackets as a character set, and thus excluding anything that includes the letter "d" or "o" or "n" or "e" (and all of your filenames contain "e"). You were then negating that condition a second time, so that rather than excluding all ...


4

You can poke around the system to find indicators. One way is to check for the existence of three directories: /usr/lib/systemd tells you you're on a systemd based system. /usr/share/upstart is a pretty good indicator that you're on an Upstart-based system. /etc/init.d tells you the box has SysV init in its history The thing is, these are heuristics that ...


4

You wrote *.{mkv} instead of *.mkv. Therefore the loop will only loop about the one "file" *.{mkv} which does not exist. In this case the output of mediainfo is simply empty. Add something like echo "$file" in your loop to verify.


4

This is actually quite a difficult problem. One of the major difficulties is that the places where one most often wants to do this are the places where it's quite likely that one will be in the middle of installing or changing stuff. Another is that there's a subtle but very important difference between the system management toolset that is installed, the ...


4

Instead of piping find into the loop, you could go through an intermediate file. That will ensure that the finding step and the looping step happen in sequence, with no overlap. Something like the following (I altered your expression for brevity): find \( -name '*.mkv' -o -name '*avi' \) >files <files while IFS= read file do ffmpeg -i "$file" ...


3

brandbot: tool to write branding to /etc/os-release When you start it1, it looks for /var/lib/rhsm/branded_name and adds in /etc/os-release: PRETTY_NAME=first_line_from_branded_name 1Path-based activation — System services that support path-based activation can be started on-demand when a particular file or directory changes its state. Systemd uses path ...


3

It's because the device nodes no longer exist on your system (probably udev removed them when the drive died). You should be able to remove them by using the keyword failed or detached instead: mdadm -r /dev/md0 failed # all failed devices mdadm -r /dev/md0 detached # failed ones that aren't in /dev anymore If your version of mdadm is too old to do ...


2

In CentOS7, you have systemctl that will pretty much do most of this for you. If Apache is installed via the standard packages, this should work for you out-of-the-box: echo -n $(date +"%s %F %T"): \ if systemctl is-active httpd; then \ systemctl stop httpd && echo "httpd stopped"; \ elif systemctl enable httpd; then \ systemctl start httpd ...


2

What I ended up doing was using mknod like @derobert suggested to create the devices that mdadm was looking for. I tried the major/minor numbers mdadm was telling me it couldn't find with the different drive letters I was trying to remove until it worked. mknod /dev/sde1 b 8 17 Then I had to use the --force option to get it remove the component. mdadm ...


2

Remove the '{}' from in the 'for file' part. It should be like this instead: for file in *.mkv; do height=$(mediainfo "$file" | grep -E 'Height'); echo $height; height=${height//[!0-9]/}; echo $height; done In your code the "*.{mkv}" is expanding to all files ending in '.{mkv}' of which, I presume, there aren't any, so the list in the for statement comes ...


1

Please realize this problem has nothing to do with xinitrc, or your XOrg Setup. I stand by my statement that you can: Either freeze the NVIDIA driver at 3.11.x, as this is the last driver to support the 2.6 series kernel, or: Update the kernel in your environment to at least 3.11. See justification below. This entry is in my changelog: 05 Sep ...


1

The reason the code is failing to run properly is the mismatch of AND and OR groups in the initial find command: find * \( -name '*.mkv' -o -name '*avi' -o -name '*mp4' -o -name '*flv' -o -name '*ogg' -o -name '*mov' ! -name '*-[900p-by-ZiriusPH].mkv' \) -print The binding for the parameters is to print the files matched for Name *.mkv OR Name *.avi OR ...


1

It is a tool that write branding to /etc/os-release which in turn contain operating system identification data.


1

Here is my onliner: ( if service httpd status; then echo 'stop'; service httpd stop; else echo 'check installed'; if ! rpm -qa | grep -q '^httpd-'; then echo 'install'; yum -y install httpd; fi; echo 'start'; service httpd start; fi ) &> /tmp/temp.log; cat /tmp/temp.log >> /log/httpd/some.log; cat /tmp/temp.log >> ...


1

The Linux console itself does not support displaying Chinese, but you can run some alternative console(such as kmscon) to display Chinese without starting X.


1

They are in /usr/lib/kbd/consolefonts which is owned by the kbd-misc package.


1

Set the hostname with: hostnamectl --static set-hostname host.domain


1

OK, I found myself in exactly the same position. It seems CentOS creates a small root volume by default and fills the remainder of your space with /home. I even tested my setup first in a VM but with the smaller disk CentOS didn't create the home volume. I picked up on this problem before becoming space constrained tho' and also figured how not to have to ...



Only top voted, non community-wiki answers of a minimum length are eligible