Using the mkinitcpio net hook confuses netcfg

Hello everybody.
I am currently trying to build a headless Linux home server, and I decided to try out Arch.
The server has an encrypted root file system by means of having a plain-text /boot 1st partition and having the / file system on a 2nd LUKS partition.
For starters I used the mkinitcpio hooks "keymap keyboard encrypt", with the appropriate "cryptdevice=..." and "root=..." kernel parameters to make the server prompt me for the pass phrase in early user space, which works nicely.
As this thing is supposed to become a headless system I then tried to set it up in a way that enables me to open an SSH connection into the early user space and supply the pass phrase from there, using dropbear_initrd_encrypt. And it works! This is great stuff.
Unfortunately doing this broke the then-running server's network connection.
I have a static IP address netcfg profile that is loaded from systemd on server start-up (systemctl enable netcfg; the profile is set in the "NETWORKS=..." variable in "/etc/conf.d/netcfg").
The ethernet device is called "enp2s0".
This worked flawlessly until I started using the "net" mkinitcpio hook to get a network connection in early user space for the remote unlocking.
The net hook's corresponding kernel parameter looks like "ip=<ip>:::<netmask>:::none"
When I use this hook, the system boots up without having the "enp2s0" ethernet device, causing netcfg to bail out.
It does however gain the same network device as "eth0" instead, which is apparently how early user space calls it. This "eth0" ethernet device appears to retain the settings it has been set up with by the net hook.
Unfortunately the net hook does not supply things like a default gateway or DNS servers, so while the server technically is reachable from the local network, it cannot access the internet, which it definitely needs to be able to do.
After tracking this down I figured "Whatever. I can live with the ethernet device being called eth0."
So I made a second identical netcfg profile, exchanging "enp2s0" for "eth0", and set the server to load that one instead when booting.
That unfortunately did not work either, because netcfg is cautious and aborts when it is told to set up a network adapter that is already active in some way unknown to netcfg.
What also didn't help was specifying the "enp2s0" ethernet device name in the "ip=..." kernel parameter for the net hook, because indeed the early user space only knows the device as "eth0".
So for now I'm stumped. Anyone experienced this issue and managed to solve it?
A solution might be another "disablenet" mkinitcpio hook that deconfigures the network adapters configured by "net", so that the renaming from "eth0" to "enp2s0" during boot, which I assume fails on account of "eth0" being active, works again.
Thanks for any help,
eomanis
Edit: Changed "netctl" to "netcfg" in the thread subject
Last edited by eomanis (2013-04-18 08:45:21)

tomk wrote:You could try including the appropriate command to bring down your interface in your profile's PRE_UP field.
Okay, I tried that.
I put both netcfg profiles into the "NETWORKS=..." variable in "/etc/conf.d/netcfg", and added this to both of them:
# Clear leftover state from mkinitcpio net hook
PRE_UP="ip link set <device> down || true"
where <device> is eth0 or enp2s0, respectively.
After a reboot with remote decryption the server's network was down completely. Looks like the "ip link set ... down" command worked all right, but the rest didn't go as planned.
Here's what systemctl says about that:
[root@hserver autologin]# systemctl status netcfg
netcfg.service - Netcfg multi-profile daemon
Loaded: loaded (/usr/lib/systemd/system/netcfg.service; enabled)
Active: failed (Result: exit-code) since Thu 2013-04-18 22:35:38 CEST; 26min ago
Process: 340 ExecStart=/usr/bin/netcfg-daemon start (code=exited, status=1/FAILURE)
Apr 18 22:35:35 hserver netcfg-daemon[340]: :: static_enp2s0 up Cannot find device "enp2s0"
Apr 18 22:35:35 hserver netcfg-daemon[340]: Interface enp2s0 does not exist
Apr 18 22:35:35 hserver netcfg-daemon[340]: [fail]
Apr 18 22:35:38 hserver netcfg-daemon[340]: :: static_eth0 up RTNETLINK answers: File exists
Apr 18 22:35:38 hserver netcfg-daemon[340]: Could not configure interface
Apr 18 22:35:38 hserver netcfg-daemon[340]: [fail]
Apr 18 22:35:38 hserver systemd[1]: netcfg.service: main process exited, code=exited, status=1/FAILURE
Apr 18 22:35:38 hserver systemd[1]: Failed to start Netcfg multi-profile daemon.
Apr 18 22:35:38 hserver systemd[1]: Unit netcfg.service entered failed state
As before, device "enp2s0" is missing, but "eth0" doesn't come up either, even after being downed manually beforehand :-(
Strangely enough, if I do "netcfg -u static_eth0" after that, eth0 does come up. What?!
@falconindy: Applying a udev rule in early user space would require to make a custom initcpio hook, wouldn't it?
In that case I'd rather try to figure out what the "net" hook does and undo it, seeing that I have to write a custom hook anyway and that "eth0" doesn't come up no matter what.
Having an "enp2s0" ethernet device that doesn't come up either isn't going to do me much good ;-)
Thanks for the suggestions,
eomanis

Similar Messages

  • Mkinitcpio net hook broken?

    Hi
    I'm trying to upgrade my diskless PXE system, but it seems like the mkinitcpio "net" hook is broken?
    # mkinitcpio -p kernel26
    ==> Building image "default"
    ==> Running command: /sbin/mkinitcpio -k 2.6.32-ARCH -c /etc/mkinitcpio.conf -g /boot/kernel26.img
    :: Begin build
    :: Parsing hook [base]
    :: Parsing hook [net]
    which: no ipconfig in (/lib/initcpio)
    ERROR: '/lib/initcpio/ipconfig' is not a file
    which: no nfsmount in (/lib/initcpio)
    ERROR: '/lib/initcpio/nfsmount' is not a file
    :: Parsing hook [udev]
    :: Parsing hook [autodetect]
    error: /dev/sr0: No medium found
    :: Parsing hook [pata]
    :: Parsing hook [scsi]
    :: Parsing hook [sata]
    :: Parsing hook [filesystems]
    :: Generating module dependencies
    :: Generating image '/boot/kernel26.img'...SUCCESS
    ==> SUCCESS
    ==> Building image "fallback"
    ==> Running command: /sbin/mkinitcpio -k 2.6.32-ARCH -c /etc/mkinitcpio.conf -g /boot/kernel26-fallback.img -S autodetect
    :: Begin build
    :: Parsing hook [base]
    :: Parsing hook [net]
    which: no ipconfig in (/lib/initcpio)
    ERROR: '/lib/initcpio/ipconfig' is not a file
    which: no nfsmount in (/lib/initcpio)
    ERROR: '/lib/initcpio/nfsmount' is not a file
    :: Parsing hook [udev]
    :: Parsing hook [pata]
    :: Parsing hook [scsi]
    :: Parsing hook [sata]
    :: Parsing hook [filesystems]
    :: Generating module dependencies
    :: Generating image '/boot/kernel26-fallback.img'...SUCCESS
    ==> SUCCESS
    The two errors in the net-hook, makes my system unbootable:
    /init: line 113: nfsmount: not found
    ERROR: Failed to mount the real root device.
    Bailing out, you are on your own. Good luck.
    /bin/sh: can't access tty; job control turned off
    [ramfs /]#
    The system gets stuck now and doesn't accept any input from my keyboard.
    I'm using the following hooks within my mkinitcpio.conf:
    MODULES="nfs"
    HOOKS="base net udev autodetect pata scsi sata filesystems"
    System is up to date as of today:
    # pacman -Q kernel26 mkinitcpio
    kernel26 2.6.32.9-1
    mkinitcpio 0.6.3-1
    # pacman -Syu
    :: Synchronizing package databases...
    core is up to date
    extra is up to date
    community is up to date
    :: Starting full system upgrade...
    local database is up to date
    Anyone?

    djgera wrote:You need mkinitcpio-nfs-utils
    Thanks, I missed that one in the news...
    Problem solved

  • Communicting with a device that uses the K-Net protocol

    I have HPLC pump that was built in Germany. The K-Net protocol is used to communicate with the device serially (RS232). Does anyone have any experience/ insight about how to do this. Is there any VI's that will convert ascii commands to this K-Net protocol?? Thanks.
    ssmith

    Hey ssmith,
    Thank you for contacting National Instruments.  If you know the commands you will be using to interact with the pump, you can use VISA commands in LabVIEW to handle the communication. 
    If you do not have the VISA driver installed, you can find that here: NI-VISA 4.2
    Also, you might try searching our Instrument Driver Network, as there could be a driver already developed for your pump that would make things easy for you.
    Regards,
    Kevin H
    National Instruments
    WSN/Wireless DAQ Product Support Engineer

  • Internet access using the 3G net in Sweden

    Hi! Swedish users hopefully understands what I meen if my English is poor. Thinking about buying a iTouch, my question is if it is possible to get online using a 3G modem? My provider in Sweden is Telenor and I have one of theirs modem.
    Thanks!
    /u

    frittfall,
    The iPod Touch uses WiFi only.
    The iPhone will use EDGE networks where available. In the U.S. most GSM locations that have 3G also have EDGE, including all of AT&T's 3G areas. EDGE, sometimes called 2.5 or 2.75G, was skipped over in some countries, and so you will only have GPRS (2G) in 3G areas.
    Hope this helps,
    Nathan C.

  • DGW and using the BP Properties options confusion

    Scenario:
    I have two different document generation sets saved:
    DGW is run and save with name name1and it using BP Selection Criteria with  the BP properties button set to use "And with properties 1 checked."
    DGW is run again and save with name2 and it using BP Selection Criteria with  the BP properties button set to use  "And with properties 2 checked"
    When I then run DGW and select use existing parameter set Setname1 and go to the BP Selection Criteria and check the properties button it has properties 2 checked, where it was saved with properties1 checked.
    Is this normal behavior or am I doing something wrong?
    I am on 2007A SP0 PL42
    Edited by: Art Puliafico on May 3, 2010 6:29 PM

    You need to set the EssProperties class you created into the EssOperations class:set oEssOperations.EssProperties = <your property class instance>Alternatively, you can modify, in place, the instance of EssProperties that EssOperations already has:with oEssOperations.EssProperties .MissingTextString = "Boo!" .UseAliases = trueend withThink of the Essbase Objects Base Classes sort of as a molecule.. The 'basic atom' of the molecule is the EssOperations class (which contains the normal retrieve/zoom/pivot type of operations). Attached to the 'basic atom' are the things that are needed for a successful operation.. First, a connection (the EssConnection object) is 'plugged into' the molecule. Next, properties (an EssProperties object) is plugged in.. Finally, you need a grid to display it on so you plug in a grid object (or, more technically, one of the components that implement the IEssGrid interface).Once you have all of the 'atoms' of the grid plugged in, you have everything you need to do a successful operation.Tim TowApplied OLAP, Inc

  • How to use the embeddable designer in VB6

    I realize that I'm late to the party, but ......
    I use Visual Basic 6 and CR XI. I do NOT design my reports with the embedded designer in the VB6 UI but rather build them in CR XI as rpt files and then have a viewer app in my VB6 code that displays the report(s) to the CR XI Viewer control.
    I have looked at the sample that uses the embeddable designer in the VB6 UI and am intrigued.  It looks to me like there would be a designer object for each report.  In an app with multiple report capability, would I have a separate designer object for each report?  The default viewer code that launches when a designer is added to the VB project seems very tied to the designer.  I'd like to have one viewer form and multiple designers.  Does anyone have sample code that would demonstrate this?
    Thanks.

    Hello John,
    your question is more developer related.
    Please add your new question in the right [dev forum|https://www.sdn.sap.com/irj/sdn/businessobjects-sdk-forum].
    To answer this question : Yes it is possible to create MDI application with multiple viewer and embedded designer. Each viewer can have its own designer, no problem.
    I would not have code for VB as lots of programmers prefers C++ for those tasks.
    If needed I can send you  C++ sample for CR XI R2 for the RDC.
    In addition, it is even easier to use the new .NET platform to create projects like this.
    Please find some starting ideas in code on our [dev site|https://boc.sdn.sap.com/dotnet/samples].
    Best regards

  • Net Hook driver

    Hi;
    I'm trying to port a Linux Kernel Module we wrote to Solaris 10.
    The modules uses the Linux Netfilter Hooks to do packet manipulations before they get to the application.
    Is there a similar way in Solaris 10 to filter/manipulate tcp/ip packets ?
    I need something similar to the :
    Pre-Routing
    Local
    Forward
    Post-routing
    Hooks that I get from the netfilter interface in the Linux Kernel
    But anything similar that let me filter / change packet will be ok
    Thanks

    Hello,
    <br><br>
    the STREAMs between IP<->TCP (lately IP<->UDP) was removed in Sol10, you can add streams below IP (like IpFilter). New architecture (FireEngine) whitepaper is here . There was also xpert discussion. Some book, presentation, previous discuss or blogs 1 + 2 maybe usefull.
    <br><br>M.C>

  • How to Run teststand sequence file using the LabVIEW

    Hi
    I want the execute the Teststand Sequence file using the LabVIEW .Net containers.I didnt find out the Execution Parameter in the .Net Container.Do you any suggestion regarding this question.Please let me know.
    Jayavel

    TestStand comes with loads of Operator Interface examples some simple, some full fledged. You can find it in teststand public folder win7 path here:C:\Users\Public\Documents\National Instruments\TestStand 2010 SP1\UserInterfaces
    You can take these examples or use ideas from here, also read the teststand reference manual. It has a section about Operator Interfaces.
    Beginner? Try LabVIEW Basics
    Sharing bits of code? Try Snippets or LAVA Code Capture Tool
    Have you tried Quick Drop?, Visit QD Community.

  • [SOLVED]Netcfg works great manually, but when using the daemon it wont

    I installed netcfg a really long time ago following the arch wiki. When I first installed it and set everything up, it was all working perfectly.
    For the past three or four months Ive been having problems where netcf daemon is failing to connect (home wireless network 256bit wep). It takes about 20 seconds just waiting and eventually says failed. If I log in and run the command manually (sudo netcfg home-wifi) it connect perfectly fine every time.
    Ive tried everything I can think of including different QUIRKS and changing permissions on the profiles but nothing works. I also tried using the netcfg menu but it doesnt work like that either. I went over the wiki page again thinking something might have chnaged, but its all the same. I even reinstalled and configured again but still nothing.
    heres my rc.conf
    # /etc/rc.conf - Main Configuration for Arch Linux
    # LOCALIZATION
    # LOCALE: available languages can be listed with the 'locale -a' command
    # HARDWARECLOCK: set to "UTC" or "localtime", any other value will result
    # in the hardware clock being left untouched (useful for virtualization)
    # TIMEZONE: timezones are found in /usr/share/zoneinfo
    # KEYMAP: keymaps are found in /usr/share/kbd/keymaps
    # CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US)
    # CONSOLEMAP: found in /usr/share/kbd/consoletrans
    # USECOLOR: use ANSI color sequences in startup messages
    LOCALE="en_US.UTF-8"
    HARDWARECLOCK="UTC"
    TIMEZONE="America/New_York"
    KEYMAP="us"
    CONSOLEFONT=
    CONSOLEMAP=
    USECOLOR="yes"
    # HARDWARE
    # MOD_AUTOLOAD: Allow autoloading of modules at boot and when needed
    # MOD_BLACKLIST: Prevent udev from loading these modules
    # MODULES: Modules to load at boot-up. Prefix with a ! to blacklist.
    # NOTE: Use of 'MOD_BLACKLIST' is deprecated. Please use ! in the MODULES array.
    MOD_AUTOLOAD="yes"
    #MOD_BLACKLIST=() #deprecated
    MODULES=(acpi-cpufreq cpufreq_ondemand vboxdrv loop)
    # Scan for LVM volume groups at startup, required if you use LVM
    USELVM="no"
    # NETWORKING
    # HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
    HOSTNAME="Arch"
    # Use 'ifconfig -a' or 'ls /sys/class/net/' to see all available interfaces.
    # Interfaces to start at boot-up (in this order)
    # Declare each interface then list in INTERFACES
    # - prefix an entry in INTERFACES with a ! to disable it
    # - no hyphens in your interface names - Bash doesn't like it
    # DHCP: Set your interface to "dhcp" (eth0="dhcp")
    # Wireless: See network profiles below
    #Static IP example
    #eth0="dhcp"
    eth0="dhcp"
    INTERFACES=(eth0)
    # Routes to start at boot-up (in this order)
    # Declare each route then list in ROUTES
    # - prefix an entry in ROUTES with a ! to disable it
    gateway="default gw 192.168.0.1"
    ROUTES=(!gateway)
    # Enable these network profiles at boot-up. These are only useful
    # if you happen to need multiple network configurations (ie, laptop users)
    # - set to 'menu' to present a menu during boot-up (dialog package required)
    # - prefix an entry with a ! to disable it
    # Network profiles are found in /etc/network.d
    # This now requires the netcfg package
    NETWORKS=(home-wifi)
    # DAEMONS
    # Daemons to start at boot-up (in this order)
    # - prefix a daemon with a ! to disable it
    # - prefix a daemon with a @ to start it up in the background
    DAEMONS=(syslog-ng crond hal cpufreq !network net-profiles @netfs @alsa @sensors @mpd)
    What gets me is that it actually takes longer to fail then it does when I manually connect. It times out for like 20 seconds, but when I manually connect its almost instantaneous.
    Last edited by tjwoosta (2010-03-02 05:31:37)

    I had arch installed on my Sony VAIO, had this problem, and then fixed it somehow.  That was several months ago, recently I fried the laptop so I just reinstalled and can't remember.  But now I have a "solution"  haha
    this is kind of silly how I got it to work, though.
    I created another profile "home-wifi-boot" with a short timeout, this is called from rc.conf.
    then I put "/usr/bin/netcfg home-wifi" in my /etc/rc.local  , which is exactly the same but has a 30 sec timeout.
    This just does the same thing as I was doing manually, runs netcfg a second time.  It works for me!
    Last edited by jamba (2010-02-14 15:30:58)

  • I can't activate my iPad and I'm sure i am using the correct apple id and password but when i press net it says it cannot be used to unlock this iPad

    i can't activate my iPad and I'm sure i am using the correct apple id and password but when i press net it says it cannot be used to unlock this

    You can try to figure out which Apple ID/email address and/or password you used to activate it by going to http://iforgot.apple.com
    If you can't, you'll need to contact Apple Account Security with your proof of purchase. 

  • I'm trying to hook up my Macbook Pro to my TV. I'm using the 'mini-display port to female HDMI" adapter. all i can see is my desktop background. no folders or icons and when i play a movie it goes blank.

    I'm trying to hook up my Macbook Pro to my TV. I'm using the 'mini-display port to female HDMI" adapter. all i can see is my desktop background. no folders or icons and when i play a movie it goes blank.

    Drag applications from your main desktop off the right side of the screen and they will appear on the TV.  This is the extended desktop mode. 
    Regards,
    Captfred

  • I have recently unlocked my iPhone 4. I got the comforation saying it was unlocked. For some reason I cannot access my network settings? Any suggestions. I am trying to use the phone on Net 10 network.

    I recently unlocked my iphone 4. I am trying to use it on Net 10's network. However, i cannot access the network settings. I have the Net10 Sim already in it. A few notes listed below of what i have tried:
    1.) I downloaded the iphone configuation utility. But  cannot get the right settings to apply. (so if you have the correct ones i could use those)
    2.) i have watched 1000 youtube videos and been on practically every page online and tried 1000 different versions of APN settings through the configuration
    3.) I do not have another SIM card from another carrier to try.
    Open to suggestions on how i can get the APN settings to change. Not worried about picture messaging or anything, but would like my internet to work. Calls and text work fine.

    i have seen this option..problem being...i dont have access to WIFI i live in the middle of ten buck too! We cant even get internet out here i have to go a friend house to get internet. I was going to try that once i did get to town but was looking for other options here at home frist.

  • Me and my sister use the same itunes but on my new iphone i have a different apple id. how do i hook up my iphone to get the music from her account because my device wont show up in our itunes

    Me and my sister use the same itunes but on my new iphone i have a different apple id. how do i hook up my iphone to get the music from her account on to my iphone because my iphone wont show up in our itunes.

    1patiot1 wrote:
    someone please tell me how to fix this. I cant access any apps or anything because my old apple id keeps showing up on my phone and wont show the new one.
    You created a new AppleID?
    Why not simply update your old AppleID so you have only one iTunes account?

  • My wife and I each have an apple ID and share one macbook pro. Is it possible to use the iCloud on our shared macbook pro and our two separate iPhone 5's and not get each others information confused?

    My wife and I each have an apple ID and share one macbook pro. Is it possible to use the iCloud on our shared macbook pro and our two separate iPhone 5's and not get each others information confused?

    Once you setup your wife's account you can enable fast user switching to make it easy to switch accounts:
    OT

  • I have two accounts and for both accounts I use the same emails. I cannot verify my email on my main account because of this. Help? Can I just cancel my other account to avoid confusion?

    I have two accounts and for both accounts I use the same email. I cannot verify my email on my main account because of this. Help? Can I just cancel my other account to avoid confusion? I am totally stuck now.

    By the sounds of it you have linked Email Accounts, if so this means that you will both recieve the majority of the same Emails, and if you do and you read them on your account (which is linked with your husbands) then they will appear to read on the both of them because they are linked. With the majority of Email providers these days they're Emails are (simplified) in the cloud you could say, meaning that if you read or delete shared Emails then it will do the same on both accounts rather than just the yours.
    I hope all that made sense, sorry that I couldn't be of anymore assistance.. If you havent already try googling your problem - you may find some answers on there

Maybe you are looking for

  • Blank Page in Smart Forms

    Dear All A blank page is printing in Invoice through Smart Forms. Help Me? Thanks in Advance

  • Best settings for import

    i asked a question here http://discussions.apple.com/thread.jspa?threadID=464588&tstart=0 regarding different sound qualities. i'm also wondering if it is partially due to the settings i have for importing songs. i import using MP3 at 192 kbps. shoul

  • Performance counter registry hive consistency failed

    Hi everybody, i just bough a tablet from China running Window 8.1 32 bit os sytem.  i tried to install sql server 2008 rs but i got this error, performance counter registry hive consistency failed i tried to google the result but i got stuck. i open

  • Process using Webservice in Reader and Writer becomes slow while connecting processors

    Hi, I have a process that reads from a web service and writes to a web service. When I try to modify the code(after stopping the running process) by adding new processors or change the current connections, the connecting arrows take forever to connec

  • Date formula to convert 2015-06-07 00:00:00.000 to Jun-15

    Hi All; I have a date in the format new_duedate = 2015-06-07 00:00:00.000 i need to convert it to Jun-15 I am currently using below  formula CONVERT(CHAR(4), (new_duedate), 100) + CONVERT(CHAR(4), (new_duedate), 120) which converts into Jun 2015 Any