Changing env vars "upstream"? (how do you change MPD_HOST?)

on desktops, you usually have a process tree that goes something like (well, this is only one branch):
init───login───bash───startx───xinit─┬─.xinitrc───sessionmanager─┬─WM
we all know that env vars are passed on "down the tree". but this sometimes bothers me, for example when using mpd. it uses a variable MPD_HOST
so when i have a running desktop, and i want to use an other mpd instance I must change MPD_HOST.  I can only do this in the "local" environment.  the widgets in my WM, the interfaces that I use etc cannot be aware of the changed variable.
how do you guys handle this?
I have some ideas for solutions:
1) make MPD_HOST=mpdhost and use /etc/hosts to make it point to other things. but that won't help for MPD_PORT or non-mpd related variables.  not mentioning some apps might cache dns internally. and this requires root
2) hack my session manager so that i can somehow notify it (signals, let it listen to a socket, etc) and have it change an environment variable.  but i don't know if the changed variable will automatically "propagate downstream" (probably not).
any more ideas?
thanks.

hm yeah, it obviously won't work for running instances of programs - it just makes sure that changes in env (in the respective env-file) take effect for all new instances of $program.
You can eg use gdb to change the env of a running process (have a look at this script for reference http://www.nanonanonano.net/linux/chenv) , but most of the time that won't help you. Typically env vars are only evaluated at startup and then used to populate the appropriate structures. You'll probably have to implement the required functionality yourself in every single program.
For MPD a more or less simple workaround might be writing a small proxy that allows you to switch its destination on the fly - but i don't know whether MPD's protocol is stateful and whether clients will handle the transition gracefully.
Last edited by raf_kig (2010-02-12 14:55:02)

Similar Messages

  • How do you change the direction of a Tween Wipe effect

    Hi all,
    Completely new to the forums and I hopefully my query is straight forward.  How do you change the direction in the pre-built tween effects available within Flash CS3 (primarily the Wipe effect).  Example code:
    var Animate_Box:Tween = new Tween(Box, "height", Strong.easeInOut, 0, 200, 1, true);
    OR
    var Animate_Box_2:Object = {type:Wipe, direction:Transition.IN, duration:1, easing:Strong.easeInOut};
    TransitionManager.start(Box_2, Animate_Box_2);
    Many thanks in advance.
    Kam
    ANSWERED:
    Sorry for posting something so pointless!
    You simply add 'startPoint:5' onto the end i.e.
    var Animate_Box_2:Object = {type:Wipe, direction:Transition.IN, duration:1, easing:Strong.easeInOut, startPoint:5'};
    TransitionManager.start(Box_2, Animate_Box_2);
    startPoint:5' = can be any number depending on the direction of the Wipe you want.
    Thanks,
    Kam

    What you really want is a way of automatically mirroring the the X and/or Y coordinates of the keyframes within the effect. This ability would be very useful.
    But right now there's no way to do that. You'd have to do it manually. That effect actually uses the Slide parameter to generate the movement (instead of a discreet X/Y coordinate for the position.) Changing the first keyframe value of the Slide parameter to a negative number still doesn't give the effect I think you're looking for.
    So, it's probably easier to just rebuild the effect the way you want it from scratch.
    Bony

  • What is ChangeWatcher? How do you stop Change Watcher from listening to a propertyChangeEvent?

    What is ChangeWatcher? How do you stop Change Watcher from listening to a propertyChangeEvent?

    ChangeWatcher is a class used to handle the change of a specific property. To stop watching that property, simply call unwatch function as follow:
    var cw:ChangeWatcher = ChangeWatcher.watch( this, "propertyName", changeHandler );
    cw.unwatch();

  • How can you change your security question for I tunes?

    How can you change your security question for I tunes?

    If you have a rescue email address (which is not the same thing as an alternate email address) set up on your account then the steps half-way down this page give you a reset link on your account : http://support.apple.com/kb/HT5312
    If you don't have a rescue email address (you won't be able to add one until you can answer 2 of your questions) then you will need to contact iTunes Support / Apple to get the questions reset.
    Contacting Apple about account security : http://support.apple.com/kb/HT5699
    When they've been reset (and if you don't already have a rescue email address) you can then use the steps half-way down the HT5312 link above to add a rescue email address for potential future use

  • How do you change your thumbprint for iPhone 5s?

    How do you change your thumbprint for the iphone 5s?

    Go to Settings > General > Touch ID & Passcode, enter your passcode, then Turn Passcode Off will delete all current fingerprints. You can then turn passcode back on and enter fingerprints.
    Rather than deleting, you can also add the same fingerprint a second time via "Add a fingerprint" in Settings > General > Touch ID & Passcode, enter your passcode, then Touch ID.

  • How do you access updates to apps from the App store after changing to a new ID because the password on the old ID was changed and you don't know what it is now?

    How do you access updates to apps from the App store after changing to a new ID because the password on the old ID was changed by the former husband and you don't know what it is now?  And you set up your own new ID and account but can NOT access the updates, from the App store for the many apps that you already have, because they require that you sign in with that former now inaccessible ID and account and password?  Call it a problem of modern times and changing relationships, if you want to be charitable.

    So I guess it will only be new apps that I download that are allowed to give me their updates while 13 updates wait for me on an ID I can no longer access.
    Yes...  sorry.
    In the future, if need be, you can re download your purchases for free  >  Downloading past purchases from the App Store, iBookstore, and iTunes Store
    Good rule of thumb is to back up your purchases regardless  >  Mac App Store: Backing up your app purchases

  • How do you change to single click to open files and folders?

    How do you change from double clicking a file/folder, to single clicking (web style)?

    Finder > Preferences
    Turn it off it irks you. I find it exceedingly useful.

  • HT5312 How do you change the email address used to send security answers?

    How do you change the email used to send the security answers you have forgotten? I have changed the alternative email adress in Name, ID and Email Addresses but this does not change the email address in the Password and Security section.

    Jus what do you want to accomplish? The Apple ID email address is used for variosu thing onthe iPod like:
    - For purchasing media. Srrings.iTunes and App stores. Sing out and sign into anoterh account
    - Settings>iCLoudl for iCloud account
    - Settings>FaceRome for Apple ID and where You can Be Reached At email address
    - Settings>Messages for Send And Receive email address.
    - Maybe for Game Center

  • Same question for the "2 iPhones in one account".....How do I change the name.  My iPhone is showing my wife's iPhone name when I am syncing it.  Why is that?  I know about using one iTunes account....But how do you change the name w/o erasing your data?

    Hi....How do you change the name?  When I sync my iPhone, it shows my wife's name on it?

    Unfortunately it is not doing it....
    Let me give more details..We have 3 iPods and 2 iPhone4....I recently purchased the iPhone4 and when we connected it..It was already reading my wife's iPhone4..We went to the Apple Store at the Grove today and was told to de-authorize the system and connect my iPhone4 back and I should be able to change the name.
    Nothing happened..Right now, I clicked on RESTORE settings...and it is uploading a new iPhone update. 

  • How do you change multiple songs genre at the same time

    How do you change multiple song's genre at the same time with out during them one a time in ITunes  on Windows 8?

    You can select a range of songs by selecting the first, then holding shift when clicking on the last. You can ctrl+click to add or remove from the selection. Once you have a selection press Ctrl+I to Get Info. Type in the new Genre and press OK.
    tt2

  • HT204053 I used one Apple ID to set up iCloud after iOS 6 was downloaded to my iPhone, now I want to change the Apple ID for iCloud on my iPhone but I'm unable to. How do you change the ID after it's been set up?

    I used one Apple ID to set up iCloud after iOS 6 was downloaded to my iPhone, now I want to change the Apple ID for iCloud on my iPhone but I'm unable to. How do you change the ID after it's been set up?

    See https://discussions.apple.com/message/19218571#19218571.

  • How do you change your apple id on your iphone 5

    how do you change your apple id on your iphone 5. I also increased storage and cannot update to latest software upgrade! ANNOYING!!!!
    Yes, I logged in and out of the Ap Store and it is correct on that end. I have signed in on my PC too and connected cell. I am out of tactics to resolve! Please help!

    If your phone is signed into an old ID and you are trying to change it to an updated version of the old ID, do the following:
    Make sure you are signed into iMessage and FaceTime with your current ID.  If they are signed into the old ID, go to Settings>Messages>Send & Receive and Settings>FaceTime, tap the ID, sign out, then sign back in with your current ID.
    Then temporarily recreate the old ID by going to https://appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID.  Click edit next to the primary email account, change it back to your old email address and save the change.  (You should not have to verify the old email account so it doesn’t matter if you no longer have access to it.)  Now go to Settings>iCloud, turn off Find My iDevice and enter your current password when prompted (even though it prompts you for the password for your old ID).  When finished goThen go to Settings>iCloud, tap Sign Out (or Delete Account if you are not running iOS 8) and choose Delete from My iDevice when prompted (your iCloud data will still be in iCloud).  Next, go back to https://appleid.apple.com and change your primary email address back to the way it was.  Now you can go to Settings>iCloud and sign back in with your current iCloud ID and password (your data will download back to your device).

  • How do you change your apple id and password on your iPhone?

    How do you change your apple id and password on your iphone?

    To change your Apple ID go to Settings>Store>Apple ID, tap the ID shown, sign out, sign back in with the ID you want to use.  To change the password go to https://appleid.apple.com/, click on Manage you account to the right, sign in, click on Password and Security on the left, the Change Password on the right.  If you change your password you will need to sign out on your phone, then sign back in using the new password.

  • How do you change the Apple ID for my iPhone 4?

    How do you change the Apple ID for my iPhone 4. I am able to access my iTunes account using my new ID and password on my computer; however, my iphone has a different Apple ID and I do not have cannot access iTunes on this phone. 

    Also, if you have iCloud, you will probably also want to change the iCloud account on the phone to be yours:
    Settings>iCloud - if Account is not yours, go to the bottom and Delete Account. Then sign back on with your iCloud account info.
    Cheers,
    GB

  • I changed my email address and now i can no longer download apps.  Also, how do you upgrade to a new version?

    I changed my email address and updated it to my married name. As a result, when I try to download an app, it keeps telling me that I have the wrong password, despite resetting my password.
    I have not "upgraded" to the new OS for quite a while... When I try to download an app, it states that I need "OS 3.2".. or some later version...
    How do you update to a new version.  It keeps telling me to go to itunes.com and click on update.  I'm not seeing this at all.

    Did you just change your address, or create a new iTunes account? If it is not a new account you will first have to fix the password problem. Email iTunes Store support if you cannot figure out how to resolve the problem. Have you updated your login on the phone, in addition to iTunes on your computer?
    To update your iPhone you need to install the latest version of iTunes (10.5). You also need an iPhone 3GS or iPhone 4. The 3G cannot be upgraded beyond 4.2.1.

Maybe you are looking for