Fedora 20: Services failing to start on boot
Thursday, October 23. 2014
Something funny happened to my Fedora 20 installation. Stuff that used to work stopped doing so. I understand, that I'm dealing with "bleeding edge" Linux-distro, but it kind of starts to annoy me, when things don't get back like they were.
Here is one:
# systemctl status iscsi.service --all
iscsi.service - Login and scanning of iSCSI devices
Loaded: loaded (/usr/lib/systemd/system/iscsi.service; enabled)
Active: inactive (dead)
start condition failed at Thu 2014-07-17 12:23:18 EEST; 1min 24s ago
none of the trigger conditions were met
Docs: man:iscsid(8)
man:iscsiadm(8)
Jul 17 12:23:17 box systemd[1]: Started Login and scanning of iSCSI devices.
Jul 17 12:23:18 box systemd[1]: Started Login and scanning of iSCSI devices.
Aow come on! "none of the trigger conditions were met"!! I don't know what changed with the precious trigger conditions. Basic checks didn't reveal anything noteworthy:
# systemctl is-active iscsi.service
active
# systemctl list-dependencies iscsi.service
iscsi.service
There are some other people suffering from the same issue. Fedora 20 ypbind won’t start at boot. NIS logins unavailable immediately after boot (ypbind service NOT started). and Bug 1027114 - nfs mount fails during boot because network is not ready point me to the direction of service trying to start too early. There is a document explaining how to run services only after network is up (Running Services After the Network is up), but the point is: somebody goofed! This used to work.
I tried a classic off/on -trick:
# systemctl disable iscsi.service
# systemctl enable iscsi.service
... no avail. Still after a boot I have a list of failing services:
# systemctl --failed
UNIT LOAD ACTIVE SUB DESCRIPTION
arpwatch.service loaded failed failed Arpwatch daemon which keeps track of ether
dhcpd.service loaded failed failed DHCPv4 Server Daemon
iscsi.service loaded failed failed Login and scanning of iSCSI devices
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
3 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
Finally I chose to add the After=network-online.target -line to my service description. First the service description needs to be copied from /usr/lib/systemd/system/ into /etc/systemd/system/. The rule is very simple: don't edit files under /usr/ and it applies also here. Systemd has a built in fall-back mechanism. If your own tailor made file doesn't exist in /etc/, it will take the default one. It is good to have that, but better if no such tinkering wasn't needed at all. What if there is an update to the service-description? I have to manually update my copied file.
So, I did a:
# cd /etc/systemd/system/
# cp /usr/lib/systemd/system/iscsi.service .
and edited the file. I added one line to Unit-description:
[Unit]
After=network-online.target
To be absolutely clear: I didn't touch the other lines.
Since systemd doesn't pick up the changes very easily, I did a:
# systemctl disable iscsi.service
# systemctl enable iscsi.service
after status informed, that my change was in place:
# systemctl status iscsi
iscsi.service - Login and scanning of iSCSI devices
Loaded: loaded (/etc/systemd/system/iscsi.service; enabled)
Notice how, the service description is now under /etc/.
Anyway, that did the trick for all of my failing services. Now they start nicely on bootup.
OS X Yosemite upgrade from USB-stick
Saturday, October 18. 2014
Latest OS X version Yosemite or 10 is out. Funny thing, the operating system 10 has a version 10 released.
The thing is ... it's free, but it's big. The amount of downloading needed is easily 5+ GiB. When I downloaded mine, it said 6 hours of load time. On my 250 Mbit/s fiber! Argh. It downloaded a hour or so and choked completely. Argh, argh! When I resumed, it picked a better server and I got rest of the file in 10 minutes or so. Anyway, I absolutely, positively don't want to do that on all of my Macs. So, let's figure out something smarter on that.
The sources of my information are:
- How to Burn OS X Yosemite to a USB Flash Drive
- DISKUTIL(8) - BSD System Manager's Manual
- Disk Management From the Command-Line, Part 2
- Starting from an external USB storage device (Intel-based Macs)
Step 0: Prerequisites
USB-booting a Mac is trickier than a PC. The knowledge base article HT1948 states:
Intel-based Macs support starting from an external USB storage device's volume that:
- Has been formatted with a GUID partition type
- Contains an installation of Mac OS X 10.4.5 or later, or Mac OS X 10.5 or later, which is compatible with (or shipped with) the Mac that the USB device is connected to. Note: You should not use a version of Mac OS X that is earlier ("older") than the version your Mac shipped with.
So, if you just bought an USB-stick, the chances are, that it is MBR-partitioned FAT32. That's my experience of getting new ones. They are incompatible at their current state for USB-booting a Mac. Not to worry, that can be fixed!
Step 1: Go download
In your Apple menu (the top left apple-shaped thing at every program's menu), go for Software Update. Yosemite should be there as a free download from App Store. Select it and wait ... wait forever!
In the classic Commodore 64 game Impossible Mission the phrase was "Another visitor! Stay a while; stay forever!". [Actually the mission was possible. As the game was pretty good, I completed it a number of times.]
Step 2: Go USB
Now that you have the thing in your drive, don't proceed with the upgrade.
do not proceed! You can actually quit the installer, it won't delete the files from your drive.
Take at least a 8 GiB USB-storage. 4 won't do it, but any larger will. In my case, the USB-stick appeared as /dev/disk3. That may vary on your system. Also it is possible to use some GUI-tools on OS X to format your drives, but as a Linux-nerd I don't know about them.
To make sure, the stick is in a Mac-format (this needs to be run as root, that's what the sudo is for). This will partition and format the entire stick into Mac-use:
# sudo /bin/bash
root# diskutil partitionDisk /dev/disk3 1 GPT jhfs+ "OS X Yosemite" 0b
It will say something like this as a result:
Started partitioning on disk3
Unmounting disk
Creating the partition map
Waiting for the disks to reappear
Formatting disk3s2 as Mac OS Extended (Journaled) with name OS X Yosemite
Initialized /dev/rdisk3s2 as a 7 GB case-insensitive HFS Plus volume with a 8192k journal
Mounting disk
Finished partitioning on disk3
/dev/disk3
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *8.0 GB disk3
1: EFI EFI 209.7 MB disk3s1
2: Apple_HFS OS X Yosemite 7.7 GB disk3s2
Next thing is to confirm, that the volume with given name will be mounted:
root# ls -l /Volumes/
total 40
lrwxr-xr-x 1 root admin 1 Oct 17 13:27 Macintosh HD -> /
drwxrwxr-x 7 root wheel 306 Oct 18 13:12 OS X Yosemite
If it does, you're ready to go. Copy the thing into it:
root# cd "/Applications/Install OS X Yosemite.app/Contents/Resources"
root# ./createinstallmedia --volume /Volumes/OS\ X\ Yosemite/ \
--applicationpath /Applications/Install\ OS\ X\ Yosemite.app \
--nointeraction
It will result in a lengthy process saying:
Erasing Disk: 0%... 10%... 20%... 30%...100%...
Copying installer files to disk...
Copy complete.
Making disk bootable...
Copying boot files...
Copy complete.
Done.
Step 3: Go update
Your stick is ready. This is the part you will be replicating to any of your Macs you want to upgrade.
Reboot the Mac and make sure to boot from the USB. This can be achieved by pressing down option-key during boot:
The official Apple instruction at knowlegebase article HT1948 states:
To start from a USB storage device that meets the above requirements:
- connect the device
- restart
- immediately press and hold the Option key to access Startup Manager
If you successfully followed the steps, you will end up in Mac boot manager:
In that, you pretty much select the drive you want to boot from. In this particular case, making a choice for the recently prepared USB-stick will be a good one. The network selection is there to confuse you. Ignore it and double click the USB-drive.
Most steps in this upgrade will include lot of waiting. Make sure that you have reserved couple of hours for the upgrade. Screens like this will become familiar to you:
Most time estimates are wild guesses. A 9 minute wait in reality is something like 45 minutes. Eventually the USB-stick finishes booting, and you will end up in a screen saying "To set up the installation of OS X, click Continue". Most screens will refer your upgrade as an install. It is nerve-wrecking thing, because you don't know if it is going to wipe your settings and data, or do a nice upgrade what you'd be expecting. My experience is, that it will upgrade nicely, but it won't say it properly.
Then there is a license screen which you must agree to continue. Then land on OS X Utilities. One thing you can do with a bootable stick is to install/upgrade an OS X:
This is the most time-consuming part. A cup of coffee doesn't do it. You can easily cook and eat a meal with the coffee during this. My hardware isn't especially old or slow, but ... the upgrade is.
After a reboot, you will end up in the OOBE (or out-of-box experience). This will start with Apple ID login. Apple makes an effort to not allow stolen hardware to be used and they pretty much require you to login during install:
Since I have a 2-factor authentication enabled for my Apple ID, a 2FA-screen will appear during the process:
There are steps about sending your usage data to Apple, then yet another license screen:
Then you need to make the choice of upgrading iCloud into iCloud Drive, the new thing that came with iOS 8 and OS X Yosemite:
Then you're pretty much done. Finally your upgrade is ready!
Step 4: Done!
One of the first things I did, was eject my USB-stick (there were couple other Macs to be updated, too):
At this point, you can continue using your precious Mac.
Aftermath
Was it worth it? Not really, the change is mainly cosmetic. iCloud Drive isn't a reason for me to upgrade. Apple-menu doesn't have System Update anymore, they changed it into App Store. That's like running iOS.
I updated anyway, as a nerd I like the latest stuff running on my computers. I should yield less problems and there needs to be some progress. I find myself stating the same thing in couple of my blog posts, "it wasn't worth it, but I did it anyway". With computers, it never will result any good to stand still and ignore future.