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.

Similar Messages

  • Some init scripts disappeared?

    Hi
    I upgraded using pacman -Syu yesterday, then I found some init scripts(/etc/rc.d/nginx  /etc/rc.d/postgresql) disappeared.
    I searched about it but found nothing.

    peonone wrote:I searched about it but found nothing.
    Really?
    Read the front page news:
    https://www.archlinux.org/news/end-of-i … s-support/
    https://www.archlinux.org/news/final-sy … n-warning/

  • 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 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]

  • 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.

  • [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

  • 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!

  • I know this is a little early, but I have some really great ideas for ios 8. How can i submit these to apple?

    some of my ideas are
    1. lockscreen widgets
    2. the ability to kill all running apps with just one button
    3. having the ability to select your albums and songs within the pull up controll center
    4. Incorperating battery saving technologies from mavericks into ios 8, such as time collessing, and app nap
    how do i subbmit these ideas

    Apple does not accept unsolicited product ideas. You can submit feedback using the link razmee provided, but don't expect any acknowledgement.

  • 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).

  • Looking for some DBA scripts.

    I am a DBA. Can any off u send me few sql scripts which would help me in monitoring the DBA activities, Like
    a) Monitoring the Disk Usage for a particular Database.
    b) How to check the rollback segment is increasing or not.
    c)In NT where the datafiles stored (i.e. in which table)
    and if any more u come across.
    My email add is [email protected]

    Did you ever get any info about this question? I am also a new DBA and trying to set up some monitoring scripts that will monitor the disk usage of our table spaces. Any help will be appreciated.
    Thanks,
    Susan Williams

  • 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.

  • Pls give some shell scripting for sql/plsql

    pls give some shell scripting for sql/plsql

    794244 wrote:
    pls give some shell scripting for sql/plsqlNeither SQL or PL/SQL are shell script languages. Both are server side languages that executes inside an Oracle database server process.
    This is an important concept to understand when using SQL*Plus for example to "script" interaction with an Oracle database.

  • MDT WinPE TSEnv variables and pathing some powershell scripts.

    Hi again everyone!
    I have a question about running some powershell scripts inside of MDT.  Now I know that you can create a powershell command in the task sequence, and that will create the proper elevations and such, but I would like some organization here.  I have
    been creating my OS modification scripts inside of an Image Utilities folder under applications and then calling them with a powershell.exe windowstyle -hidden script.ps1.  The scripts will run, but I have alot of custom unpackaged stuff that I'm trying
    to quickly move and create on the freshly deployed OS.  My issue comes in with using things like copy-item .\items -destination c:\itemdest\ .  I have a folder that I created with some items that need to be in the OS image process, plus the
    powershell script.  I was thinking maybe I could do some sort of set unc=%~dp0 or something and make a $env:unc or something, but I was hoping someone might've solved this already.  Thanks in advance for any help.
    Ryan

    Hi Ryan,
    Sorry but you're not being clear enought for me. I usually need things dumbing down for me to understand. :)
    =%~dp0 is the current folder. I'll assuming from that, you're trying to get the same thing in PowerShell.
    There's a number of ways depending of what you're trying to do.
    $PWD is usefull from the command line
    The $MyInvocation object holds a wealth of info from the path to the executable/function used.
    There's a blog on it here How can a script tell what directory it was run from?
    Also, the best place for help on this kind of thing is the scripting guys forum. I hope this puts you in the right direction.
    /Andrew
    Blog: http://scriptimus.wordpress.com

  • I need to insert some Java script in my muse page. What is the best way to do that?

    I have a site I've built in Muse. I need to add a video (and not via youtube) to my  Muse site as well as some Java script. I'm not sure how to do that. I have some Java script to make appointments and scheduling but can't add it to that Muse page. Any thoughts? Thanks

    1. right click on your page
    2. choose page properties
    3. choose metadata
    4. add javascript in head section
    <script type="text/javascript">
    </script>
    or choose object and then insert html
    you can right click that object and choose edit html and (re)write code.

  • Arch32 init script in wiki incorrect ?

    Hi all,
    after the death of my 500GB SATA drive I had to (re)install arch64 on my box. For setting up the arch32 chroot I followed the guide as found in the wiki here:
    http://wiki.archlinux.org/index.php/Ins … _in_Arch64
    Unfortunately this new arch32 init script...
    #!/bin/bash
    . /etc/rc.conf
    . /etc/rc.d/functions
    dirs=(/proc /proc/bus/usb /dev /dev/pts /dev/shm /sys /tmp /home)
    case $1 in
    start)
    stat_busy "Starting Arch32 chroot"
    for d in "${dirs[@]}"; do
    mount --bind $d /opt/arch32/$d
    done
    add_daemon arch32
    stat_done
    stop)
    stat_busy "Stopping Arch32 chroot"
    for d in "${dirs[@]}"; do
    umount -l /opt/arch32/$d
    done
    rm_daemon arch32
    stat_done
    restart)
    $0 stop
    sleep 1
    $0 start
    echo "usage: $0 {start|stop|restart}"
    esac
    exit 0
    ...gives me the following error when I try to start the 32 bit chroot:
    :: Starting Arch32 chroot                                                [DONE]
    ./arch32_new: Zeile 16:  : Kommando nicht gefunden. <- this means command not found.
    Fortunately I had archived several pages from the wiki as pdf when I set back my first arch64 system. The old arch32 init script looks like this:
    #!/bin/bash
    . /etc/rc.conf
    . /etc/rc.d/functions
    case $1 in
    start)
    stat_busy "Starting Arch32 chroot"
    mount --bind /proc /opt/arch32/proc
    mount --bind /proc/bus/usb /opt/arch32/proc/bus/usb
    mount --bind /dev /opt/arch32/dev
    mount --bind /dev/pts /opt/arch32/dev/pts
    mount --bind /dev/shm /opt/arch32/dev/shm
    mount --bind /sys /opt/arch32/sys
    mount --bind /tmp /opt/arch32/tmp
    mount --bind /home /opt/arch32/home
    add_daemon arch32
    stat_done
    stop)
    stat_busy "Stopping Arch32 chroot"
    umount /opt/arch32/proc/bus/usb
    umount /opt/arch32/proc
    umount /opt/arch32/dev/pts
    umount /opt/arch32/dev/shm
    umount /opt/arch32/dev
    umount /opt/arch32/sys
    umount /opt/arch32/tmp
    umount /opt/arch32/home
    rm_daemon arch32
    stat_done
    restart)
    $0 stop
    sleep 1
    $0 start
    echo "usage: $0 {start|stop|restart}"
    esac
    exit 0
    This one works perfectly for me.
    Questions:
    - Has anyone of you used the new script without error message ?
    - What could cause the "command missing" error message ?
    I can post the old script in the wiki if the new one has errors.
    Regards,
    D$

    The script does seem to be a little broken alright, try with this one (untested)
    #!/bin/bash
    . /etc/rc.conf
    . /etc/rc.d/functions
    dirs=(proc proc/bus/usb dev dev/pts dev/shm sys tmp home)
    case $1 in
    start)
    stat_busy "Starting Arch32 chroot"
    for d in "${dirs[@]}"; do
    mount --bind /$d /opt/arch32/$d
    done
    add_daemon arch32
    stat_done
    stop)
    stat_busy "Stopping Arch32 chroot"
    for d in "${dirs[@]}"; do
    umount -l /opt/arch32/$d
    done
    rm_daemon arch32
    stat_done
    restart)
    $0 stop
    sleep 1
    $0 start
    echo "usage: $0 {start|stop|restart}"
    esac
    exit 0

Maybe you are looking for

  • Crystal Reports export and print fails with SSL / https but works with http

    Windows 2008 Server, 32-bit (IIS7) ASP.NET 2.0 Ajax 1.0 Crystal Reports version 10.5.3700.0 http:  printing works, export works https:  printing not working, only export to MS Excel and MS Word work. I am able to generate reports using both http and

  • Access 2007 ODBC connect to Oracle 10g

    I have configured MSAccess 2007 on my laptop with a ODBC data source to my Oracle Database and I can link to tables in the Oracle database and everything works. I have placed the Access Database on a 64 bit server running Window 2003 r2 Enterprise x6

  • Why do my Itunes files skip when playing?

    Alright, I have noticed when I am playing music on Itunes that the files are skipping, usually within the first few seconds of the song beginning. What is up with that!?!? I purchase the files from Itunes. I am paying full price for the songs, but th

  • What is the meaning of "Item Created by Posting Interface" flag

    I saw a flag checked in Display Document : Offsetting item window. Below is the F1 help of it. But still I didnot get the concept of this flag. Item Created by Posting Interface Use Indicates that the G/L item is generated in the posting interface fo

  • Definition of various colours in project info

    The Project Info shows Bar Charts in three colours, namely green, yellow and red. I guess the green and red are selfexplanatory, but what meaning is attached to the colour yellow? Hank iMac 20 G-5, 768 of RAM; 12 PowerBook G-4, Matrox 300 GB, Sony HC