WOL, init scripts and KDE

Hello
So, I may be confused with how init scripts are working, but in this case there is something I do not get.
I am trying to be an energy efficient geek, so I decided to set-up a Wake On Lan (WOL) on my home server. The WOL itself is working fine, no issue on this side, but in order to have this working after each reboot, and according to the wiki, I have to add the following code to my rc.local file to set the WOL flag to my network interface.
ethtool -s eth0 wol g
And here is the problem : by default, my "server" starts a kde session after the boot. So my inititab is like that :
## Only one of the following two lines can be uncommented!
# Boot to console
# id:3:initdefault:
# Boot to X11
id:5:initdefault:
# Example lines for starting a login manager
#x:5:respawn:/usr/bin/xdm -nodaemon
#x:5:respawn:/usr/sbin/gdm -nodaemon
x:5:respawn:/usr/bin/kdm -nodaemon
#x:5:respawn:/usr/bin/slim >/dev/null 2>&1
With these settings, the WOL flag is not set correctly after the boot. Now, if I do not start kde, use a console login and change my inittab to :
## Only one of the following two lines can be uncommented!
# Boot to console
id:3:initdefault:
# Boot to X11
#id:5:initdefault:
# Example lines for starting a login manager
x:5:respawn:/usr/bin/xdm -nodaemon
#x:5:respawn:/usr/sbin/gdm -nodaemon
#x:5:respawn:/usr/bin/kdm -nodaemon
#x:5:respawn:/usr/bin/slim >/dev/null 2>&1
In this case, the command in rc.local is executed correctly and my WOL flag is set as I want. So, either kde overwrites the flag when it starts or the rc.local file is not executed.
Anyone with a clue of what is going on and how to solve that ?
Thanks !
Last edited by Cobaltounet (2011-02-02 04:25:24)

zenlord wrote:
Since your problem is solved, it might be the right time to ask my question to you regarding WOL:
My server broadcasts it's IP across the network to be discoverable as a uPNP-server. I'm guessing that functionality will be lost if it is turned off, so I should configure all my uPNP-clients to send a magical packet whenever I decide to use them (which would be nearly impossible: I don't see this possibility for a PS3...)
I am not an expert in uPNP, but I am afraid that there is not a lot of solutions to your problem. If your server is powered off, then something has to wake him up. You can probably do that from your laptop/desktop or your router directly but I do not think a PS3 can do it. And having to send the magic packet manually each time you want to use a uPNP device kind of defeat the convenience of the uPNP.

Similar Messages

  • [SOLVED] netatalk and postfix init scripts (not systemd)

    Hey, does anybody have an older version of Arch running somewhere?
    I'm looking for init scripts for netatalk and postfix that I've just re-built from ABS on an outdated Arch system. However, both packages offer systemd support these days and no love for dissidents like myself.
    They are probably very simple to write on one's own, but I just want to make sure I don't overlook some important trick.
    If someone could possibly post those either here or on dpaste.org or whatever paste service you love, I would be a very happy person lol
    Last edited by iliv (2013-12-01 14:17:00)

    netatalk is in the AUR https://aur.archlinux.org/packages/netatalk/
    postfix: https://projects.archlinux.org/svntogit … a3365f273e

  • Some init script ideas

    I'm packaging GNUstep... again (this time from CVS), and it requires a certain shell script to be sourced by every shell.  That's easy enough for any user to do by modifying their .foorc and adding it in there, but I thought I would just throw a command in the postinstall to symlink the shell script to /etc/profile.d, so every login shell would automatically source it.
    That's all fine and dandy, but xterms by default aren't login shells, so anybody using an xterm would find themselves without a working GNUstep build environment unless they set xterm to be a login shell in their .Xdefaults.
    Change #1) Make xterms login shells by default in Arch's xfree86 distribution
    Now that xterms are all login shells, and we can expect a user's shell to be a login shell by default, why not add scripts to profile.d for the various self-contained distributions that live in /opt (like gnome, kde, java, etc.) that automatically set up the paths for those binaries.  At the moment, it appears you have to do this manually (I have not installed gnome or kde though, maybe those maintainers are doing this).
    Change #2) Have packages that live in /opt add a script to profile.d setting up the paths and environment necessary to use those packages.
    Thirdly, there's two daemons that need to be started for GNUstep when xfree86 starts (specifically gdnc and gpbs).  Once again, this is something that can easily be done by a user editing their .Xsession, but I'd rather automate it.  In the spirit of Arch's init script system, I think it would be wise to make an xinit.d directory (possibly in /etc, or more to the keeping of X's directory structure, in /etc/xinit.d), full of files that are run whenever X is started.  These could be enabled and disabled in rc.conf just like init scripts in rc.d currently are.
    Change #3) Add an xinit.d directory, in the spirit of rc.d and profile.d, full of items that are run whenever X is started.
    Perhaps some of this has already been done, or perhaps there are other solutions.  I just think these changes would be well in the spirit of Arch, and a boon to package maintainers.
    Please give me your feedback either here or by mailing me at [email protected]
    -- Michael Baehr

    sarah31 wrote:most if not all /opt package sets have profile.d scripts.  some may not think so but one has to log out then in to enable them.
    Good Looks like profile.d is being used for the right purpose.  I should've expected it would be  :oops:
    Xentac wrote:Ok... but what happens if I'm running blackbox?  I probably don't want gdnc and gpbs started when I start X, it'd make me cry.  How would xinit.d help with that?
    I don't see why it'd make you cry.  Let me explain what gdnc and gpbs are:
    GNUstep Distributed Notification Center
    Handles messaging and notification between GNUstep applications
    GNUstep Pasteboard Server
    Handles rich copy and paste between GNUstep applications
    Basically, none of these would impact whatever environment you'd be running, and only GNUstep apps would use them.  In fact, you wouldn't even realize they were running as they'd just be sitting in the background like the valiant daemons they are, waiting to be called into service for the holy emperor GNUstep  :twisted:
    And in any case, with the whole xinit.d idea, you should be able to just disable it with a ! if you don't like it
    I might as well throw in my last idea, which I forgot to write before.
    I've noticed people complaining about Pacman upgrades wiping their pacman.conf, which is a problem if you're using several people's TURs and other external repositories like I am.  Instead, I propose doing what APT has been doing in a recent version with its new sources.list.d layout... having one directory (pacman.repo.d or something of its ilk) storing files for each repository, and enabling and disabling them in pacman.conf the way you do in rc.conf (with a bang).  This would be especially nice because somebody could install a package called, for example, "pacman-TUR", and have a repo file for each TUR, and then be able to enable or disable them.  This package would be updated every time a new TUR was added or one was removed, thus enabling people to easily track the latest repository happenings, while still maintaining control over what repos they use.
    Just a thought.

  • [solved] Issue with conky and Kde 4

    I have a small issue with conky and KDE 4.2. I start conky with a script which I stored under ~/.kde/Autostart. The script is simple and looks like this..
    conky -c ~/.conkyrc_kde4
    This works fine. But when I restart the first KDE and check with ps, I have 2 instances of conky running. The instances keep on growing with the number of restarts.
    I think kde tries to restart all the apps which were running when the session was terminated. Is there a way to change this behavior in general or all the programs or for only a specific program like conky ?
    Last edited by rangalo (2009-07-28 19:02:17)

    I did
    Systemsettings > Advanced > Session Manager > Start with an empty session
    and put everything you want in Autostart

  • [RESOLVED] Script at KDE startup

    I'm trying to run a script at KDE startup, I tried the following:
    user.desktop file in:
    $HOME/.config/autostart
    or a all.sh file in:
    $HOME/.kde4/Autostart
    The former has my preference. I checked that these scripts and paths are present and enabled in KDE System Settings -> Startup and Shutdown but these files do not seem to be triggered by KDE. What could be the problem? If I double-click on the desktop file in a file explorer, then the script does get launched, so it does not seem the be a corrupt desktop file.
    My desktop file:
    [Desktop Entry]
    Exec=sh -c "${HOME}/%/start/all.sh"
    Hidden=false
    Name=User Startup
    Type=Application
    Last edited by OutOfPhase (2011-11-20 21:34:25)

    You could try using the autostart kcm in systemsettings. By default, you should find that plasma-desktop (or netbook) and perhaps krunner are pre-enabled for autostarting. If you want to dig deeper, these files are being placed in .kde4/share/autostart/, not in the directories you've been trying. Try the GUI for easy set up. Or place your .desktop files in that directory and edit accordingly (using the already working .desktop files as a guide) to have it work.
    Last edited by karper (2011-11-15 20:36:08)

  • Init scripts

    It has been a while since I last posted, but I like arch.
    My question is regarding the init scripts used in arch.  Specifically, three common commands used in the init scipts, and they are "stat_fail","stat_done", and "add_daemon".
    Could some refer me a wiki, webpage or man page for them, and yes I see there definitions in /etc/rc.d/functions file.

    For example in add_daemon:
    add_daemon() {
            [ -d /var/run/daemons ] || mkdir -p /var/run/daemons
            touch /var/run/daemons/$1
    What is the variable $1 refer to?  I cannot see it defined anywhere else in the function or in the /etc/rc.d/functions script.  Could it be the function referred to in which /etc/rc.d/"script" is run; "script" being whatever init service that is started and stopped,  ie crond would be then touch /var/run/daemons/crond?
      For what it is worth I am just trying to improve my shell scripting skills.
    [/i]

  • Oracle 10g R2 for Windows ignores init.ora and registry values

    Hello,
    I have a strange issue. I try to set some parameters for Oracle but it doesn't seem to work.
    Here the story:
    I created the DB with the DBCA under windows and set my init parameter at frist creation with 3 important values:
    OS_AUTHENT_PREFIX = ""
    REMOTE_OS_AUTHENT=TRUE
    remote_login_passwordfile=EXCLUSIVE
    this values are in the Registry and the init.ora and the init.ora.7192011143454 in ORAHOME_DB/scripts and pfile
    I've now changed these parameters in the init.ora and registry to:
    OS_AUTHENT_PREFIX = ""
    REMOTE_OS_AUTHENT=FALSE
    remote_login_passwordfile=EXCLUSIVE
    and restarted the whole system - after the restart I checked the value for REMOTE_OS_AUTHENT:
    show parameter remote_os_authent
    NAME TYPE VALUE
    remote_os_authent boolean TRUE
    It keeps true. But why it keeps true why I can't change this value anymore after the DBCA?
    Do I miss something?
    Thanks
    Edited by: ioGLNX on 22.08.2011 04:18

    show parameter spfile;
    NAME TYPE VALUE
    spfile string C:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\SPFILEMACSCURR.ORA
    NAME TYPE VALUE
    I have created a new spfile from my init.ora with:
    create spfile='C:\oracle\product..toMyInstanceDbs\ioglnx.ora' from pfile='C:\pathToPfile\DBHOME\scripts\init.ora'
    So the problems as it seem to me to instrcut oracle to use my new spfile...in Windows.

  • Dhcpcd starting by wich init-script? [Solved]

    I have static ip on both eth devices.  These configured by netcfg: with if1 and if2 files in /etc/network.d/
    here they are:
    cat /etc/network.d/if1
    CONNECTION='ethernet'
    DESCRIPTION='ethernet connection to internet'
    INTERFACE='eth0'
    IP='static'
    ADDR='10.85.231.106'
    NETMASK='255.255.0.0'
    GATEWAY='10.85.231.65'
    DNS=('10.85.224.33')
    cat /etc/network.d/if1
    CONNECTION='ethernet'
    DESCRIPTION='ethernet connection to localnet'
    INTERFACE='eth1'
    IP='static'
    ADDR='192.168.225.222'
    NETMASK='255.255.255.0'
    But my resolve.conf sometimes is overwritten by dhcpcd.
    in /etc/rc.conf I don't have any property connected with net set except HOSTNAME="ramazotty" and NETWORK_PERSIST="no"
    my daemons are:
    DAEMONS=(hwclock syslog-ng network net-profiles sshd samba xinetd @cupsd dbus @netfs crond)
    Who in the world is starting dhcpcd?
    p.s. The parent is process 1:
    >ps -f `pidof dhcpcd`
    UID        PID  PPID  C STIME TTY      STAT   TIME CMD
    root       497     1  0 15:09 ?        Ss     0:00 dhcpcd -q
    Last edited by roginovicci (2012-10-26 09:16:04)

    FYI you don't need the network init script when you're using netcfg.
    This is not the answer you're looking for, just some useful information - unless you happen to be wrong about your rc.conf.

  • Synergyc as init script

    Greetings,
    I am trying to start synergyc as an init script so that it will work with slim, i copied the init script from the wiki, however, i get the error Fri Apr 13 10:16:02 2012: /usr/bin/xset:  unable to open display ""
    and the client never connects to the server.
    thanks!
    Adam

    If you're using slim, just put it in your .xinitrc, it's much easier and tends not to throw as many errors (at least for me, anyway).

  • Suggestion for init scripts

    I like the simplified sysvinit scripts that Arch uses, but I think the file locations could be improved a bit.  /etc should be reserved for configuration files only; when you put init scripts in there as well the /etc folder gets a little cluttered.
    Since we already have an rc.d folder anyway that contains some of the init stuff, why not put all rc scripts, settings, and so forth in the same rc.d folder?
    I'm probably not the smartest person to be talking about optimal naming conventions and file locations for the sysvinit stuff... I renamed my rc.conf to CONFIG.SYS and my rc.sysinit to AUTOEXEC.BAT

    tomk wrote:Could you clarify your suggestion? All the application init scripts are already in /etc/rc.d, and the system init scripts e.g. /etc/rc.sysinit, are in standard locations. The rest of /etc consists of system-wide application configs, and their locations are determined upstream.
    Also, iBertus is right.
    Well, I wasn't talking about the rest of /etc - specifically the init scripts (rc.single, rc.multi, etc.)  Alas, I'm unfamiliar with the bsd init process (or at least I was before this discussion).  Since one of the packages we install from base is sysvinit, I *assumed* (there I go again) it was indeed a SysV init process, only modified for Arch purposes.  That is, I thought y'all just arbitrarily decided to put rc.multi et al in /etc. and I was suggesting, as long as you're arbitrarily changing stuff around, why not keep all the rc. stuff together in /etc/rc.d.  Now that I know you're just conforming to bsd standards, my premise (that it was an arbitrary decision) is meaningless so I withdraw the suggestion and stand corrected.
    shining wrote:Seeing how much the rest of your post makes sense, I am not even sure if that's supposed to be a joke.
    Wow, I should have stayed back in newbie corner where there's no such thing as a stupid question!  It is a joke... and I was serious.  That is, I really did rename rc.conf to config.sys and rc.sysinit to autoexec.bat, but specifically *because* it's a joke, even if I'm the only one who will ever see it.  Kinda like the APPLE ][ logo I use for my Fluxbox wallpaper.
    Thanks for the explanations, ibertus and tomk... I obviously have a lot to learn about Arch (and *nix in general) before I'm ready to pitch in with meaningful suggestions!

  • Compiling init scripts as C

    Hello!
    A while back, I read that Blice (owner of http://its.alrig.ht/) had converted their init scripts to C to help the computer boot faster.
    Unfortunately, Blice's site seems to have disappeared, which is a shame since I'd like to read some of the information on his webpage.
    Anywho, my question is: anybody here have experience in converting startup scripts to C?
    I've rewritten the apache, ssh, and postfix startup scripts so far. I've put the code up on GitHub at http://github.com/ColinJones/binary-startup
    Any thoughts?

    I kind of like the idea myself. I would like to help with the development.
    After rethinking a bit, I don't think the hardest part to develop is the actually code, the part that is going to be challenging is the build script. I mean, if it is going to be according to my original idea, the program code itself is going to be simple but to be able to have simple program code when parsing rc.conf it means that the build script has to be a bit more complex, otherwise it will mean that the program code itself has to parse rc.conf. Well, that means if the rc.conf is going to be parsed in the first place. I think it should be parsed during build time, it will be a bit like mkinitcpio but for the initscripts but that is of course in my opinion.
    One of the first thing that needs to be done is probably do a prof-of-concept of a program + build script that can depending on the content of the config file build a program with different functionality. This is pretty much to simulate the DAEMONS array. A traditional way of doing this with statically linking is to including different files with the same interfaces and in case a functionality is not going to be present, use interface functions that are empty. This pretty much works when there isn't a lot of different functionality but I think there are to many possible DAEMONS to make this practical. I think a better way is to generate a config.h (or use a different name for the file) which contains a list of functional pointers to all the "modules" that should be included. In short, make the program aware of the function and include the file that contains the function to the linker and make the complete process dynamically.
    I might look in this prof-of-concept during the weekend.
    Last edited by PJ (2010-01-08 18:18:09)

  • Init script startup

    How does the init script system on Arch work? Coming from Ubuntu, if I wanted to add a startup script I just added it to /etc/init.d and ran update-init.d to create the necessary symlinks.
    I've looked on the wiki and searched the forum, but not found much on it. If I wanted to add a startup script, what's the best approach? It seems like the recommended way is to add the script to rc.d and to add a line to execute it in rc.local.

    It doesn't matter if it's a daemon or not, look for example at the /etc/rc.d/alsa script. It sure isn't a daemon but it's still in /etc/rc.d/ and it's still called from the daemons array in rc.conf . No, there are no symlinks, which simply means there isn't a program neither.

  • Xdg-open, magnets and KDE

    I had a problem to open magnet files from chromium. The torrent client didn't seem to launch.
    $ xdg-mime query default "x-scheme-handler/magnet"
    transmission-qt.desktop
    mime type seemed to be linked to the correct application.
    Trying to launch xdg-open from terminal :
    $ xdg-open "magnet:?somemagnet"
    QWidget: Cannot create a QWidget when no GUI is being used
    /usr/bin/xdg-open: line 513: 1568 Aborted (core dumped) kde-open --noninteractive "$1"
    I don't know why this doesn't work, or why I can't find any reference of other people with the same problem.
    I resolved the problem by patching xdg-open. I removed the --noninteractive flag from kde-open command, and all seems to work fine now. Still it troubles me why the xdg-open script doesn't work out of the box. Any ideas?

    Related bug reports in xdg-utils and KDE:
    Bug 269823 - kde-open --noninteractive foo.noassoc crashes
    Bug 16295 - xdg-open is inconsistent across desktop environments (also see http://cgit.freedesktop.org/xdg/xdg-uti … bf7ce76cb3)
    EDIT: I've opened a bug report at KDE: https://bugs.kde.org/show_bug.cgi?id=336117
    EDIT: And there's already a bug report in Arch: https://bugs.archlinux.org/task/40795
    Last edited by joschi (2014-06-12 12:24:56)

  • What is the diff b/w Sap Scripts and Smart Forms

    Hi,
          Whats the diff b/w SAP Scripts and Smart Forms..
             I need the internal explanation for both Smart Forms and SAP Scripts mean when we execute what happens whether Print Program r Forms starts execution 1st  and SIMILARLY FOR SMARTFORMS WHETHER FM'S  R FORMS.
    Thanks & Regards,
    Gopi.

    Hi
    Difference with SMARTFORMS vs. SapScript(SE71)
    The Following are the differences :-
    a) Multiple page formats are possible in smartforms which is not the case in SAPScripts
    b) It is possible to have a smartform without a main window .
    c) Labels cannot be created in smartforms.
    d) Routines can be written in smartforms tool.
    e) Smartforms generates a function module when activated.
    f) Unlike sapscripts (RSTXSCRP), you cannot upload/download Smartform to your local harddisk.
    It was said that it was provided in CRM 3.0 version, but not available in R/3. You can download smartforms into Local PC in a XML format. In the same way you can upload this XML format into Smartform. From the smartform editor itself you can call download option, if you are working in CRM 3.0 environment.
    In R3 also, you can download into XML format. However, it's not sure about uploading. Refer to the program 'SF_XSF_DEMO'.
    In 4.7 Enterprise, other have seen this utlity which is completey missing in 4.6c. There is functionality to downlaod a complete form or only a particular node. (Utilities -> Download form). It will create a XML file and save it in the hard disk.
    For others, if you want to download/upload the Smartforms source, you will need the help from the Basis people. What you can do is to create a Transport and then FTP down to your local harddisk. When you need the Smartform source in another system, you have FTP up the Smartforms file back to the SAP server. Finally, the Basis team, will tp it into your system.
    g) The protect and endprotect command in sapscript doesn't work with smartforms. For example on a invoice: First data of position no 80. is printed on page one, other data of position no 80 is printed on page 2. And there's nothing you can do about it. Actually, there is something you can do about it. By using a folder node and checking the 'protect' checkbox, everything in that folder will be page protected.
    check out this link:
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    Reward points if helpful.
    Regards,
    Swathi.

  • Mail attachment: difference between script and app bundle?

    Hiya Folks,
    I am trying to make an application in Applescript that will receive a file, then create a new email (in Mail.app) with that file attached. I would prefer it to be an app, rather than a script when it's finished. I have a script that appears to work.
    This simple script will put up a Choose File window asking for a file, then bring Mail to the front and create a new message, with the selected file attached (it won't send it). For debugging, I made a dialog box pop up showing the path to the file selected:
    -- begin script
    set OpenedFile to choose file
    display dialog "OpenedFile: " & OpenedFile
    tell application "Mail"
    activate
    set newMessage to make new outgoing message with properties {subject:"Subject", content:"Content"}
    tell newMessage
    set visible to true
    tell content
    make new attachment with properties {file name:OpenedFile} at after the last paragraph
    end tell
    end tell
    end tell
    -- end script
    So I tried to make that into an app onto which I could drag n drop a file, and have Mail make a new message with that file attached. Try saving this following script as an Application or an Application Bundle:
    -- begin script
    on open OpenedFile
    display dialog "OpenedFile: " & OpenedFile
    tell application "Mail"
    activate
    set newMessage to make new outgoing message with properties {subject:"Subject", content:"Content"}
    tell newMessage
    set visible to true
    tell content
    make new attachment with properties {file name:OpenedFile} at after the last paragraph
    end tell
    end tell
    end tell
    end open
    -- end script
    Run the first script as a script, and it works as advertised. Drag a file onto the second script saved as an app, and the message is created, but no attachment.
    Note that the path displayed in the pop-up is the same for both scripts.
    Anybody know what I'm doing wrong?
    Thanks for your help,
    Drewstre

    on open (dragged_items)
    my handleFiles(draggeditems) -- Send selected items to custom handler.
    end open
    on handleFiles(localItems)
    tell application "Mail" -- Use terms of 'Mail'
    activate -- Launch 'Mail'.
    -- Add text to 'Subject' and 'Message' fields.
    set newMessage to make new outgoing message with properties {subject:"Subject", content:"Content"}
    tell newMessage -- Set focus to 'newMessage'
    set visible to true -- Make message visible.
    repeat with i in local_Items -- Cycle through the dragged items, adding each to new message.
    tell content to make new attachment with properties {file name:i} at after the last paragraph
    end repeat
    end tell
    end tell
    end handle_Files
      Mac OS X (10.4.4)  

Maybe you are looking for

  • ICal Events on my mac not showing in reminders after upgrading to mountain lion

    after upgrading to mountin lion, all calenders on my mac are not showing in the reminders app, only calenders on icloud. The irony is all calenders created on my mac have been reclassified on iCloud. This was done automatically during the last upgrad

  • WCS 7.0.172.0 gui timeout

    Is there anyway to increase the timeout value for the gui? I have an intern positioning AP's on various map's and he gets booted off the gui at random times.  He isn't idle either. Thanks

  • Error in Invoice workflow

    Quantity entered larger than quantity to be debite Error handling for work item 000011592049 Canceled by user Canceled by user Quantity entered larger than quantity to be debite Hi All, I am gettin the above error in invoice workflow. Can anyone tell

  • E6 Home Scrren Bug

    Hi. I'm new to the forum. I've had my E6 for about six months and had occaisional bugs, but nothing major. Love the phone. The other morning when I turned my E6 on, out of the blue all my home screens were wiped (I had 4), and in place was a wallpape

  • Express edition and Credential retrieval failed - again

    Following a successfull installation of the Express edition, I get the common problems of home page not available and 'credential retrieval failed' when I try to login as the system/sysdba. I have read all the threads I have found and have found no r