Create script in /usr/bin called pacclean?

#!/bin/bash
su -c 'pacman -Qdt'
su -c 'pacman -Scc && pacman-optimize'
yaourt -Syua
this script was created to show
1) To list all packages no longer required as dependencies (orphans) (pacman -Qdt)
2) Clean the package cache of packages that are not currently installed (/var/cache/pacman/pkg) and removes all packages from the cache. (pacman -Scc)
3) Improving database access speeds reduces the time taken in database-related tasks, e.g. searching packages and resolving package dependencies. (pacman-optimize)
4) You can update your system including AUR packages (yaourt -Syua)
I think this is a good script i think, but is there a way to streamline it by not entering my password over 3 times? this script i created in /usr/bin and called it pacclean which i made it executable.

I have a script that has much the same concept as this one, but much longer. I'm sure I posted it in this forum before, but as it's changed a little recently, I'll repost here. It may give someone some ideas for how they'd like to wrap pacman themselves, or some coding style thoughts. I install this in /usr/local/sbin/pu and add that same path to sudoers with NOPASSWD set. Note that you don't have to run it with sudo yourself, as it will detect if you are not root and re-run itself in sudo for you if not. Note that this will produce a large amount of noise output on the first run, as the saved state data (/var/lib/pu) won't be populated yet, and so all the comparisons from last run to now will run as if everything in the world is brand new.
#!/bin/bash
# vim:set filetype=sh: *
if [[ "$(/usr/bin/id -u)" != "0" ]] ; then
exec /usr/bin/sudo $0 "$@"
fi
libdir=/var/lib/pu
umask 0022
export LANG=en_US.utf8
export LC_COLLATE=C
# Recreate $libdir
/bin/install -d -o root -g root -m 755 "$libdir"
/bin/rm -rf "$libdir"/*.out
if /usr/bin/tty -s ; then
# Upgrade packages
/usr/bin/pacman -Syu
else
# Update repos
/usr/bin/pacman -Sy
# List upgradeable packages
/usr/bin/pacman -Qqu | /bin/sed -e 's/^/upgradeable /'
fi
echo
# List new packages in repos
/usr/bin/pacman -Slq | /usr/bin/sort -u > "$libdir/avail.out"
[[ -f "$libdir/avail.prev" ]] || /bin/touch "$libdir/avail.prev"
/usr/bin/comm -13 "$libdir/avail.prev" "$libdir/avail.out" | /usr/bin/xargs -r /usr/bin/pacman -Si
/bin/mv -f "$libdir/avail.out" "$libdir/avail.prev"
echo
# List stray dependencies
/usr/bin/pacman -Qqdt | /bin/sed -e 's/^/stray dep /'
# List pacsave/pacorig/pacnew files in /etc
/usr/bin/find /etc \( -name \*.pacnew -o -name \*.pacsave -o -name \*.pacorig \) | /bin/sed -e 's/^/pacfile /'
# List files missing from packages
/usr/bin/pacman -Qqk | /bin/sed -e 's/^/missing file /'
# List new explicit packages
# This also catches removals from base and base-devel
/usr/local/bin/pacexp | /usr/bin/sort > "$libdir/pacexp.out"
[[ -f "$libdir/pacexp.prev" ]] || /bin/touch "$libdir/pacexp.prev"
/usr/bin/comm -13 "$libdir/pacexp.prev" "$libdir/pacexp.out" | /bin/sed -e 's/^/pacexp /'
/bin/mv -f "$libdir/pacexp.out" "$libdir/pacexp.prev"
# List new base / base-devel packages not installed
/usr/bin/comm -13 <(/usr/bin/pacman -Qgq base base-devel | /usr/bin/sort -u) <(/usr/bin/pacman -Sgq base base-devel | /usr/bin/sort -u) > "$libdir/base.out"
[[ -f "$libdir/base.prev" ]] || /bin/touch "$libdir/base.prev"
/usr/bin/comm -13 "$libdir/base.prev" "$libdir/base.out" | /bin/sed -e 's/^/base-add /'
/bin/mv -f "$libdir/base.out" "$libdir/base.prev"
# List new version-mismatched AUR packages and new foreign packages
for pkg in $(/usr/bin/pacman -Qqm | /usr/bin/sort | /usr/bin/tee "$libdir/foreign.out") ; do
localver=$(/usr/bin/pacman -Q $pkg | /bin/cut -d\ -f2)
aurver=$(/usr/bin/curl -s "http://aur.archlinux.org/rpc.php?type=info&arg=$pkg" | /bin/cut -d\" -f18)
[[ -z "$aurver" ]] && continue
[[ "$localver" != "$aurver" ]] && echo "$pkg: $localver -> $aurver"
done > "$libdir/aur.out"
[[ -f "$libdir/foreign.prev" ]] || /bin/touch "$libdir/foreign.prev"
/usr/bin/comm -13 "$libdir/foreign.prev" "$libdir/foreign.out" | /bin/sed -e 's/^/foreign /'
/bin/mv -f "$libdir/foreign.out" "$libdir/foreign.prev"
[[ -f "$libdir/aur.prev" ]] || /bin/touch "$libdir/aur.prev"
/usr/bin/comm -13 "$libdir/aur.prev" "$libdir/aur.out" | /bin/sed -e 's/^/aur /'
/bin/mv -f "$libdir/aur.out" "$libdir/aur.prev"
# Clean out old packages if cache gets too big
if [[ $(/bin/du -sm /var/cache/pacman/pkg/ | /bin/cut -f1) -gt 1000 ]] ; then
/usr/bin/pacman -Sc --noconfirm > /dev/null
echo "clean cache"
fi
# Whack perms on pacman cache into shape
/usr/bin/find /var/cache/pacman/pkg -type f ! -perm 644 -exec /bin/chmod 644 {} +

Similar Messages

  • [Solved] Permissions problem /usr/bin/install: cannot create

    I've been looking at this for quite a while now and am running out of ideas/inspiration. Google isn't helping and after reading the docs on the wiki, I'm still none the wiser.
    So, I've compiled the source code properly but my PKGFILE is having a problem at the make install stage:
    make[2]: Entering directory `/home/adam/Downloads/foo/src/foobillard-2.9/src'
    /bin/sh ../mkinstalldirs /usr/bin
    /usr/bin/install -c foobillard /usr/bin/foobillard
    /usr/bin/install: cannot create regular file ‘/usr/bin/foobillard’: Permission denied
    make[2]: *** [install-binPROGRAMS] Error 1
    make[2]: Leaving directory `/home/adam/Downloads/foo/src/foobillard-2.9/src'
    make[1]: *** [install-am] Error 2
    make[1]: Leaving directory `/home/adam/Downloads/foo/src/foobillard-2.9/src'
    make: *** [install-recursive] Error 1
    ==> ERROR: A failure occurred in build().
    Aborting...
    My PKGFILE can be seen at: http://pastebin.com/wrbZ6niq.
    TIA
    Last edited by kabads (2013-05-14 20:50:54)

    kabads wrote: and after reading the docs on the wiki, I'm still none the wiser.
    What exactly have you been reading? Because if you take /usr/share/pacman/PKGBUILD.proto or read https://wiki.archlinux.org/index.php/Creating_Packages, you can't get to what you have without some serious changes. It seems like you took some bad and old PKGBUILD (not PKGFILE) as a starting point instead of more official/up-to-date docs.
    At the very least you should read the section about the package() function.
    Edit: now you can copy/paste from the above reply, but try to understand how makepkg works. And since you passed the prefix to ./configure, it's unlikely that you'll need it again for the install step.
    Last edited by Raynman (2013-05-14 20:25:51)

  • [SOLVED] .. error: coreutils: /usr/bin/install exists in filesystem

    Hi All,
    Getting the following error:
    (85/85) checking for file conflicts [###########################] 100%
    error: failed to commit transaction (conflicting files)
    coreutils: /usr/bin/install exists in filesystem
    I am reluctant to delete/move /usr/bin/install for fear of breaking the system ..
    Anyone help here?
    Last edited by bmentink (2012-04-05 02:26:42)

    I just ran into this same issue today while performing a full system upgrade. After some investigation, I came to agree with the OP that manually removing "/usr/bin/install" is the correct action to take.
    Prior to successfully executing the full system upgrade, I found that /usr/bin/install was a symlink to /bin/install. Using "pacman -Qo /bin/install", I found that the file /bin/install was owned by the coreutils 8.15-1 package. The symlink /usr/bin/install, however, was not owned by any package. The conflict arises because coreutils 8.16-2 wants to put the new install program in /usr/bin instead of its previous location under /bin.
    My memory is a bit fuzzy, but I seem to recall running into a problem installing some third party library that had /usr/bin/install hard-coded into its build script and claimed the file didn't exist. I may have manually created the symlink /usr/bin/install to /bin/install as a quick-fix, then forgot to remove it. In retrospect, I could have confirmed/refuted this hypothesis by comparing the time stamp on the symlink /usr/bin/install to /bin/install. If the symlink was created well after /bin/install, then I'm probably to blaim; on the other hand, if the symlink was created essentially at the time /bin/install was created, then most likely the creators of the coreutils package forgot to claim ownership of the symlink.

  • /usr/bin/env

    Hi,
    I'm trying to find the difference between using env and not using it. Found this:
    The env utility is sometimes useful with the ``#!'' construct (see
    execve(2)). The only difference between ``#!/usr/local/bin/foo'' and
    ``#!/usr/bin/env /usr/local/bin/foo'' is that the latter works even if
    /usr/local/bin/foo is itself interpreted. Using env this way also allows
    one to reference foo without the path, as well as set up the environment
    as desired.
    Can someone tell me what this means:
    The only difference between ``#!/usr/local/bin/foo'' and
    ``#!/usr/bin/env /usr/local/bin/foo'' is that the latter works even if
    /usr/local/bin/foo is itself interpreted.
    What is interpreted?
    Thanks,

    I think I know what this means now.
    The shebang line only accepts binary executables. So what it is saying is that if you use env, then the line will accept regular scripts:
    #!/usr/bin/env /usr/local/bin/foo
    will work even if foo is not a binary executable.
    Thanks anyway,

  • Generate Create Script creates scripts that won't run: ORA-00922: missing..

    I'm having trouble running a script that I created by using the Generate Create Script tool in Oracle Explorer. I created the following script by running the Generate Create Script on a table called, "ASPNET_APPLICATIONS":
    CREATE TABLE "DEV"."ASPNET_APPLICATIONS" ("APPLICATIONID" NUMBER,"APPLICATIONNAME" VARCHAR2(256 BYTE),"DESCRIPTION" VARCHAR2(256 BYTE)) TABLESPACE "USERS" PCTFREE 10 INITRANS 1 MAXTRANS 255 STORAGE ( INITIAL 65536 MAXEXTENTS 2147483645 MINEXTENTS 1 )
    CREATE UNIQUE INDEX "DEV"."PK_APPS" ON "DEV"."ASPNET_APPLICATIONS" ("APPLICATIONID" ) TABLESPACE "USERS"
    CREATE UNIQUE INDEX "DEV"."IDX_APPS_APPNAME" ON "DEV"."ASPNET_APPLICATIONS" (LOWER(TRIM("APPLICATIONNAME")) ) TABLESPACE "USERS"
    ALTER TABLE "DEV"."ASPNET_APPLICATIONS" ADD ( CONSTRAINT "SYS_C004598" CHECK ("APPLICATIONNAME" IS NOT NULL) ENABLE VALIDATE )
    ALTER TABLE "DEV"."ASPNET_APPLICATIONS" ADD ( CONSTRAINT "SYS_C004597" CHECK ("APPLICATIONID" IS NOT NULL) ENABLE VALIDATE )
    I then deleted the table in my Oracle 10g database and ran the above script to recreate the table. The result is that I get an error the following error, ORA-00922: missing or invalid option. Does anyone know how to resolve this?
    Is anyone aware of any bugs in the Generate Create Script option of Oracle Explorer?

    Okay, I think I found my problem.
    I was trying to run the script created by Oracle Explorer directly from a Database project I added to my Solution in Visual Studio. Visual Studio is probably using some SQL Server specific tool when I select the Run or Run On option on the script.
    When running the same script directly in the Oracle 10g Home Page (Home > SQL > SQL Scripts), I had no problem. Everything executes correctly.
    Is anyone aware of another way to run Oracle scripts directly from Visual Studio? Do I have my project setup incorrectly? This is the first project I've used .NET and Oracle together, so if anyone has any suggestions, I'd really appreciate the help.
    Thanks,
    Mycole

  • What shell script found in /usr/sbin and /usr/bin in OS X made out off?

    What shell script found in /usr/sbin and /usr/bin in OS X made out off?
    thanks.

    You may have to provide more detail on what you're wanting to know if this doesn't answer your question.
    Shell scripts are just text files. You can create or open them with any text editor. They are executed by one of the command interpreters (such as sh, bash, csh, etc) or by a language interpreter (like perl or ruby). However, many of the items in the directories you mention are not shell scripts but rather binary executables. These are executed by the OS.
    You can use something like this to show you which are which:
    file /usr/bin/*
    Steve

  • Simple script in /usr/local/bin just won't start - SOLVED

    I put this really simple script for starting psi into my /usr/local/bin, set it a+xr and added /usr/local/bin to my path. However, I just can't start the damn thing.
    Here's the script itself (I really don't think there's something wrong with it, since if I type it in the shell it works fine):
    #!/bin/zsh/
    #start psi, never stop
    while true;
    do psi;
    done
    Here's my users $PATH:
    ─$ print $PATH
    /bin:/usr/bin:/sbin:/usr/sbin:/usr/X11R6/bin:/opt/bin:/usr/local/bin:/opt/kde/bin:/opt/mozilla/bin:/opt/qt/bin
    Here's the permissions of the script:
    $ ls -lah /usr/local/bin
    total 4.0K
    drwxr-xr-x 2 root root 80 Dec 15 03:52 ./
    drwxr-xr-x 10 root root 240 Dec 10 18:55 ../
    -rwxrwxr-x 1 kamagurka users 60 Dec 15 03:51 psi.start*
    And here's what happens when I try to execute it:
    $ psi.start
    zsh: command not found: psi.start
    So, I'm either missing something incredibly obvious, or something freaky's going on here. I hope it's the former.
    EDIT: I had no idea where to put this, so I put it into Desktop Env since I'm trying to start a graphical app, but feel free to move it.
    EDIT: Yea, I was being a little dense.

    smoon wrote:Not sure if that's the problem, but try removing the trailing / (slash) from your script's shebang.
    See, something really obvious. Stupid, even. You can see, I don't do a lot of scripting.

  • Tcl/tk:  #!/usr/bin/wish in a script file does not start wish

    When executing a tcl/tk script file, 'wish' does not execute the tcl/tk commands in the file.
    Instead I get error messages: "command not found" from tcsh for every tcl/tk command in the file. I use tcsh as login shell.
    The first line in the script file is: #!/usr/bin/wish. The program is at this place.
    Starting 'wish' with my tcl/tk file as argument works fine.
    Starting the wish.app and "sourcing" the script file works fine.
    jo

    Thanks for the help so far.
    Using
    /usr/bin/wish led.tk
    works.
    using
    ./led.tk
    does not even start wish. I checked with Activity Monitor.
    Below are my "wishes", the first one is actually a link to wish4.8.
    ls /usr/bin/wi*
    wish
    wish8.4
    wish8.4-X11
    wish8.4.7
    wish8.5
    But I am one step closer.
    Starting X11.app and starting my script in an xterm and using
    '#!/usr/bin/wish8.4-X11'
    in the script works.
    Using
    #!/usr/bin/wish8.4
    has still the same symptoms. For me it looks like a bug. I wonder if anybody can verify on MacOS 10.4.3

  • /usr/bin/ directory scripts

    I have OSX 10.9.5.  I discovered the "fuser" command in the /usr/bin/ directory is a script, instead of a binary.  Anyone have any idea why Apple would replace the "fuser" binary with a script?

    I guess because lsof does the important work, and scripting lsof did the job that was needed for fuser.  1 less executable to maintain, where that executable needs to know the inner workings of the operating system.
    It has been a perl script since at least Leopard (10.5 is the oldest system available to me).  I do not know when it first appeared, and if it was always a perl script.
    When was the last time you knew it was an executable, as you say it was replaced?
    POSX only requires that there be an fuser command, it does not dictate how that command is implemented.

  • [Solved] How to save a file in /usr/bin/local using gedit as an admin?

    In my attempt to run these two programs:
    https://github.com/kerchen/export_gr2evernote
    https://github.com/spiermar/bookmarks2evernote
    I noticed they assumed the default python is python 2. I have python 3.3.1 and 2.6.8. I'm following the instructions at: https://wiki.archlinux.org/index.php/Py … ld_scripts
    Created a file with this:
    #!/bin/bash
    script=`readlink -f -- "$1"`
    case "$script" in
    /home/Dropbox/export_gr2evernote-master1/*|/home/Dropbox/bookmarks2evernote2/*)
        exec python2 "$@"
    esac
    exec python3 "$@"
    I then, tried to save it as p2 under /usr/local/bin/ where the only thing that's there is meteor, node, and npm, and it throws me an error saying I don't have enough permissions.
    How do I save p2 as an admin in /usr/bin/local using gedit?
    I've searched on the forums 'create a file in /usr/' and I haven't found anything. Can someone please help me?
    Last edited by jjshinobi (2013-04-23 05:20:47)

    jjshinobi wrote:
    sidneyk wrote:
    jjshinobi wrote:
    I moved p2 to bin, edited my projects path with the username in front of home, saved it as python, made it executable (#sudo chmod +x /usr/local/bin/python), removed p2. Ran:
    #python evernote2enex.py -m 10
    It's still referencing python 3...
    "python3: can't open file 'evernote2enex.py': [Errno 2] No such file or directory"
    My python file contains this:
    #!/bin/bash
    script=`readlink -f -- "$1"`
    case "$script" in
    /home/<user>/Dropbox/export_gr2evernote-master1/*|/home/<user>/Dropbox/bookmarks2evernote2/*)
        exec python2 "$@"
    esac
    exec python3 "$@"
    I did everything exactly like the wiki said, what seems to be the problem?
    OK. Looking at the 2 scripts you quoted, neither one is using a shbang line to set a python version to call. Without that, the python intercept doesn't even come into play. The problem that I see is the way you are starting it:
    sudo nano /usr/local/bin/python
    Is root really necessary for these if they are in your /home/<user>/Dropbox/ directory. And it appears that you are assuming python3 when you start them that way. If you are going to use that method and they are indeed python2 scripts, then change your command to this:
    #python evernote2enex.py -m 10
    You might try it as your normal user too in case root isn't really required.
    I tested out the first ten with:
    #python2 export2enex.py -m 10
    it worked!
    then proceded with
    #python2 export2enex.py GStarred -n exported.enex
    The script is fully functional. Thanks man!
    Actually, you're not even using the script when starting your python scripts that way. You are explicitly calling either python3 (python) or python2 (python2) to run the indicated python script and not even touching the work around /usr/local/bin/python script. If your python script started with a line like either :
    #!/usr/bin/env python
    or:
    #!/usr/bin/python
    And was executable, such that you called it by it's name, i.e. "someprogram.py", then the python script in /usr/local/bin/ would take precedence and effectively intercept the python call and choose the appropriate version of python as long as the path to the directory where "someprogram.py" resides is specified in that /usr/local/bin/python script.
    Last edited by sidneyk (2013-04-25 15:40:19)

  • Make: /usr/bin/install: Command not found

    I'm working on a PKGBUILD, but I'm running into this:
    make: /usr/bin/install: Command not found
    make: *** [install] Error 127
    ==> ERROR: Build Failed.
    Aborting...
    What would cause this?  Old code?  Missing package?

    It was actually really old code, after a bit of successful this-should-probably-work script editing!  I created a package in the AUR called dasm, which is an assembler for the Atari 2600 among many other systems.
    http://aur.archlinux.org/packages.php?ID=37200

  • Executing /usr/bin/mail From Within Daemon

    I've created a script that, among other things, sends an email to an external email address and it works fine from the command line.  When the same script is run periodically from within a daemon (i.e. launchctl), the email functionality of the script does not execute.  There are no errors in the system.log, the appfirewall.log or the mail.log.  All of my referenced paths are absolute.  I'm overlooking something, but don't know what.
    Python:
    cmd = "/bin/echo \"%s\" | /usr/bin/mail -s \"%s\" %s" % (messageText.strip(),subject,receiver)
    os.system(cmd)
    The question is, why does /usr/bin/mail not function correctly from within a daemon?
    I appreciate your assistance

    > Checked man mail but nothing that I could see...
    That's because you're looking in the wrong place
    mail uses your current login name combined with the domain settings for postfix, so it's postfix's configuration you need to be looking at.
    Specifically:
    /etc/postfix/main.cf
    which states:
    # The myorigin parameter specifies the domain that locally-posted
    # mail appears to come from. The default is to append $myhostname,
    # which is fine for small sites.
    So you should change the myorigin setting to reflect the @part of addresses for mail sent from this machine. It may be as simple as:
    myorigin = $mydomain
    if you just want to append your domain name.

  • /usr/bin/bash[34]: syntax error at line 40 : `set' unexpected

    Hi All
    I would like to install Oracle Database 11gR1 On Solaris 10
    When I run root.sh command, I confused to input path
    *# cd /home/oracle11/app/oracle11/product/11.1.0/db_1*
    *# ./root.sh*
    Running Oracle 11g root.sh script...
    The following environment variables are set as:
    ORACLE_OWNER= oracle11
    ORACLE_HOME=  /usr2/home/oracle11/app/oracle11/product/11.1.0/db_1
    *Enter the full pathname of the local bin directory: [usr/local/bin]:/usr/bin/bash*
    I have inputed "/usr/bin/bash"
    Now I can not run bash on Solaris 10.
    *# bash*
    bash[34]: syntax error at line 40 : `set' unexpected
    Please help me!
    Thankyou and best regards,
    thiensu2810

    Hi
    Output of "$ find /usr -name bash 2>/dev/null" is
    *# find /usr -name bash 2>/dev/null*
    */usr/bin/bash*
    *# less /usr/bin/bash*
    +###################################+
    +#+
    +# $Header: coraenv.sh 17-may-2007.08:31:33 jboyce Exp $ coraenv+
    +#+
    +# Copyright (c) 1987, 2007, Oracle. All rights reserved.+
    +#+
    +# This routine is used to condition a C shell user's environment+
    +# for access to an ORACLE database. It should be installed in+
    +# the system local bin directory.+
    +#+
    +# The user will be prompted for the database SID, unless the variable+
    +# ORAENV_ASK is set to NO, in which case the current value of ORACLE_SID+
    +# is used.+
    +# An asterisk '*' can be used to refer to the NULL SID.+
    +#+
    +# 'dbhome' is called to locate ORACLE_HOME for the SID. If+
    +# ORACLE_HOME cannot be located, the user will be prompted for it also.+
    +# The following environment variables are set:+
    +#+
    +# ORACLE_SID Oracle system identifier+
    +# ORACLE_HOME Top level directory of the Oracle system hierarchy+
    +# PATH Old ORACLE_HOME/bin removed, new one added+
    +# ORACLE_BASE Top level directory for storing data files and+
    +..................................+
    +.................................+
    else
    if (-e $ORABASE_EXEC) then
    if (-x $ORABASE_EXEC) then
    set BASEVAL=`$ORABASE_EXEC`
    setenv ORACLE_BASE $BASEVAL
    echo "The Oracle base for ORACLE_HOME=$ORACLE_HOME is $ORACLE_BASE"
    else
    echo "The $ORACLE_HOME/bin/orabase binary does not have execute privile
    ge"
    echo "for the current user, $USER.  Rerun the script after changing"
    echo "the permission of the mentioned executable."
    endif
    else
    setenv ORACLE_BASE $ORACLE_HOME
    echo "The Oracle base for ORACLE_HOME=$ORACLE_HOME is $ORACLE_BASE"
    endif
    endif
    +#+
    +# Install local modifications here+
    +#+
    thank,
    thiensu2810

  • Why i dont have /usr/bin/mpsadmserver folder after installing sjs appserve.

    hi
    i installed sjs appserver8.12005q1 on solaris sun ray.while installing its asking me to install webserver 6.1sp4 also,and messeage queue.i installed the same.
    after done with the installation, i need to start admin console, for which i need to go to /usr/bin/mpsadmserver folder ,which i didnit find..............
    i even tried with the tool ASADMIN(by creating domains,starting them, but domain is not getting created, its saying no nspr4 in java.lib.path.........)..to start appserver console,
    can anyone guide me how to start admin console, as i was stuck up here only....i cannot go further...without starting servers...?
    Thanks
    [email protected]

    I went over this link, but still have a similar problem -- different O/S, different scenario.
    I'm trying to install this on Fedora Core 4, installing from one of the big overall download bundles that also includes the Messaging server, Web server, etc.
    I installed, but chose to configure components manually after install. Now, I'm left with a /opt/sun/ directory, but the App server has not been installed.
    I can't find the installation script or executible to install this, nor can I find this in the documentation. Anyone have any clues on this?
    Thanks,
    --Tad
    System Administrator
    Church of Scientology
    http://www.scientology-washingtondc.org

  • [SOLVED] /usr/bin/echo from systemd .service

    I use systemd to execute a shell script to change the status of an LED after boot when I reach multi-user state.  It is working fine, but I wanted to execute the shell script lines from within my systemd .service file instead of the systemd .service file executing the shell script.  Below is the systemd .service file but it’s not working.  The systemctl status shows no issues, but I have a gut feeling my problem might be related to me redirecting the /usr/bin/echo to a device. Could someone lend a suggestion?
    Description=Set Green LED
    After=multi-user.target
    [Service]
    Type=oneshot
    ExecStart=/usr/bin/echo none > /sys/class/leds/status\:blue\:health/trigger
    ExecStart=/usr/bin/sleep 1
    ExecStart=/usr/bin/echo default-on > /sys/class/leds/status\:green\:health/trigger
    [Install]
    WantedBy=multi-user.target
    Here is my systemctl status output:
    setgreenled.service - Set Green LED
       Loaded: loaded (/etc/systemd/system/setgreenled.service; enabled)
       Active: inactive (dead) since Tue 2013-06-04 14:12:52 PDT; 3s ago
      Process: 273 ExecStart=/usr/bin/echo default-on > /sys/class/leds/status\:green\:health/trigger (code=exited, status=0/SUCCESS)
      Process: 270 ExecStart=/usr/bin/sleep 1 (code=exited, status=0/SUCCESS)
      Process: 268 ExecStart=/usr/bin/echo none > /sys/class/leds/status\:blue\:health/trigger (code=exited, status=0/SUCCESS)
    Jun 04 14:12:51 pogoplug systemd[1]: Starting Set Green LED...
    Jun 04 14:12:52 pogoplug echo[273]: default-on > /sys/class/leds/status\:green\:health/trigger
    Jun 04 14:12:52 pogoplug systemd[1]: Started Set Green LED.
    If I execute the lines below from the command-line it works fine.
    /usr/bin/echo none > /sys/class/leds/status\:blue\:health/trigger
    /usr/bin/echo default-on > /sys/class/leds/status\:green\:health/trigger
    If I put the commands into a shell script and use systemd .service to execute the shell script, it works fine.  Here is that .service script
    [Unit]
    Description=Set Green LED
    After=multi-user.target
    [Service]
    Type=simple
    ExecStart=/usr/bin/sh /home/public/setgreenled.sh
    [Install]
    WantedBy=multi-user.target
    Last edited by calzon65 (2013-06-05 00:55:37)

    Systemd services are not shells.  So redirects will not work in that way.  You can use "bash -c '<command here>'" to accomplish this as that will create a shell for the command to run.  But I think that berbae is right that there are better alternatives for this.
    You can use tmpfiles (man tmpfiles.d) which you can use to simply write a value to the given path, or you can use a udev rule to run a command when that particular path is detected.  Beware though that for some things, the tmpfiles way will sometimes try to run itself before the actual creation of the directory.  So you may run into some pace conditions with that method.  For some things, it is totally reliable though... so you'll just have to test and see.
    A tmpfiles.d configuration is way easier to write than a udev rule.  But what you are trying to do would be a pretty basic udev rule, so it would probably not take you very long to learn how to do it.  It simply involves learning how to use the udevadm command really.

Maybe you are looking for

  • Moving files from PC to iMac

    I have read "Switch 101" but it wasn't terribly helpful. It tells me to transfer by ethernet cable or by network, but both methods require my knowing the PC's ISP Address or DNS Name. How do I find that information? All I really want to do is transfe

  • Error while installing Oracle 8i on RHEL 3.0, ORA-12545

    Hi, I am trying to install oracle 8.1.7 on redhat EL 3.0. Earlier i installed the same oracle i.e 8.1.7 on redhat 8.0/9.0 and it installed sucesfully. The proceudre i follow for installtion was : ####### some settings groupadd dba groupadd oinstall g

  • Batch splitting for Outbound delivery using BAPI_OUTB_DELIVERY_CHANGE

    Hi all, Let me explain the scenario first. We are going to create a delivery in SAP with some line items and send it to a non-sap third party WMS.  They will pick the goods and send the delivery confirmation back to SAP.  In SAP we need to delivery c

  • BLOB column will caused large memory consumed ?

    our appliation server is AS9.0.4 and We using this Jdev 10g with BC4J and JSP to build some application that contain blob column BC4J entity object, we found the blob column will caused the memory consumed issue , each time the contain blob column ap

  • ABAP Stack : Subroutines

    Hi Everyone, I was wondering how can you access the local variable of a subroutine using ABAP Stack. E.g. REPORT A. PERFORM B. FORM B data : var2 CALL FUNCTION C ENDFORM FUNCTION C. <access var2 here> ENDFUNCTION. I only know that you can usually acc