[SOLVED] Help with systemd .service script

Hello,
I have been using ArchLinux (ARM version) on some “plug computers” for over a year and love it.  Recently I forced myself to move to systemd by upgrading all my computers from scratch.  I migrated all my applications and learned new ways of doing things but am having trouble with one last migration.  I run a c++ communication program that monitors a TCP port for traffic.  In the past I started this program (daemon) from an entry in rc.conf.  I have read all I can about systemd’s new approach to starting daemons (https://wiki.archlinux.org/index.php/Systemd and https://wiki.archlinux.org/index.php/Systemd/Services)
So far I created what I thought is the correct systemd .service file listed below.
[Unit]
Description=EQBCS
After=network.target
[Service]
Type=simple
ExecStart=/home/public/EQBCS/eqbcs -p 12947 -d &> /dev/null
[Install]
WantedBy=multi-user.target
I put this file in /usr/lib/systemd/system/eqbcs.service.  I then ran the following commands in the following order:
systemctl daemon-reload
systemctl enable eqbcs.service (created a link in /etc/systemd/system/multi-user.target.wants)
systemctl start eqbcs.service
Here is output from systemctl (status)
eqbcs.service                                 loaded failed failed    EQBCS
I thought this would start the service but no luck.  I also thought maybe a reboot would work but no luck.  I verified I can start the daemon manually if I run /home/public/EQBCS/eqbcs -p 12947 -d &> /dev/null from the command line.
I think I am close, but after several hours of looking at examples of .service files and other posts, I am at a loss.  I am not one of those types who posts a question without taking the time to read the wealth of information on these boards, but I am truly out of ideas and can’t figure out what to do next.  I sincerely could use some help/advice.
Last edited by calzon65 (2013-06-01 21:18:20)

Thank you for the suggestions, I believe I am getting closer to success. When I run systemctl start eqbcs.servcie it starts the service but the only way I can get out of systemctl is to ^c out.
Here is my current .service file:
[Unit]
Description=EQBCS
After=network.target
[Service]
ExecStart=/home/public/EQBCS/eqbcs -p 12947
Type=forking
[Install]
WantedBy=multi-user.target
Output from systemctl status eqbcs:
eqbcs.service - EQBCS
   Loaded: loaded (/etc/systemd/system/eqbcs.service; enabled)
   Active: failed (Result: timeout) since Sat 2013-06-01 12:48:43 PDT; 2min 11s ago
  Process: 427 ExecStart=/home/public/EQBCS/eqbcs -p 12947 (code=killed, signal=TERM)
Main PID: 396 (code=killed, signal=KILL)
   CGroup: name=systemd:/system/eqbcs.service
Jun 01 12:47:13 alarm systemd[1]: Starting EQBCS...
Jun 01 12:47:13 alarm eqbcs[427]: WARNING: Running as root NOT recommended.
Jun 01 12:47:13 alarm eqbcs[427]: EQ Box Chat Server 10.12.18
Jun 01 12:47:13 alarm eqbcs[427]: Waiting for connections on port: 12947...
Jun 01 12:48:43 alarm systemd[1]: eqbcs.service operation timed out. Terminating.
Jun 01 12:48:43 alarm systemd[1]: Failed to start EQBCS.
Jun 01 12:48:43 alarm systemd[1]: Unit eqbcs.service entered failed state.
Are there any other suggestions for settings in my .service file?

Similar Messages

  • [SOLVED] Help with a simple script

    Hi guys! A problem is connected with switching cpu governors. Usually I set it by commands and made alias in .bashrc:
    sudo cpufreq-set -c 0 -g performance && sudo cpufreq-set -c 1 -g performance
    sudo cpufreq-set -c 0 -g ondemand && sudo cpufreq-set -c 1 -g ondemand
    sudo cpufreq-set -c 0 -g powersave && sudo cpufreq-set -c 1 -g powersave
    Could you help me with script which can read system information about current cpu governor and switches the next governor
    Last edited by noMaster (2012-01-27 06:36:55)

    noMaster wrote:
    JuseBox wrote:Can you please be more specific with what you are trying to accomplish?
    I need that script for set it on hotkey and change cpu states. Unfortunately I havent scripting experience
    I make one thing but it doesnt work for me
    ### Toggle Super Hybrid Engine ##################################
    she_names=("performance" "ondemand" "powersave")
    she_value_performance=( "0" "performance")
    she_value_ondemand=( "1" "ondemand")
    she_value_powersave=( "2" "powersave")
    # Find current
    she_current=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor`
    if [[ "${she_current}" == "${she_value_performance[0]}" ]]; then
    she_next=${she_value_ondemand[0]}
    elif [[ "${she_current}" == "${she_value_ondeman[1]}" ]]; then
    she_next=${she_value_powersave[0]}
    elif [[ "${she_current}" == "${she_value_powersave[1]}" ]]; then
    she_next=${she_value_performance[0]}
    fi
    function she_toggle() {
    if [[ "${she_names[${she_current}]}" != "${she_names[${she_next}]}" ]]; then
    cmd="/usr/bin/notify-send -t 5000 SHE changed"
    echo ${she_next} > ${she_current}
    else
    cmd="/usr/bin/notify-send -t 5000 SHE original"
    fi
    case $1 in
    # "debug")
    # print_debug
    "powersave")
    she_next=2
    she_toggle
    "normal")
    she_next=1
    she_toggle
    "performance")
    she_next=0
    she_toggle
    she_toggle
    esac
    ### End of file #################################################
    I am looking over the script. Without it, do you think you could explain what your trying to accomplish? What states and when should they toggle? Something rough to get an idea? I think if I am thinking correctly this could be easier then it seems. I will help ya.

  • [solved] Help with simple bash script

    #!/bin/bash
    current_state=cat /home/phil/.screen_state
    if ["$current_state" = "laptop"];
    then
    disper -S
    echo TV > .screen_state
    else
    disper -s
    echo laptop > .screen_state
    fi
    [phil@pwned ~]$ ./screenswitch.sh
    ./screenswitch.sh: line 3: /home/phil/.screen_state: Permission denied
    ./screenswitch.sh: line 5: [: missing `]'
    [phil@pwned ~]$ cat /home/phil/.screen_state
    laptop
    [phil@pwned ~]$
    I'm not sure why I'm getting the permission denied, and also I can't see whats wrong with line 5.
    Last edited by Dethredic (2011-08-21 19:46:57)

    IIRC you need spaces
    if [ "foo" = "foo" ]; then
    between '[' and another character.
    Edit: Got it.
    current_state=cat /home/phil/.screen_state
    This is plain wrong. I get 'Permission denied' too.
    Try
    current_state=$(cat /home/phil/.screen_state)
    Last edited by karol (2011-08-21 17:59:16)

  • Getting sasc-ng to work properly with systemd service files [SOLVED]

    This thread is intended for getting the following AUR packages to work with each other with systemd service scripts:
    https://aur.archlinux.org/packages/open-sasc-ng-dkms/
    https://aur.archlinux.org/packages/open-sasc-ng/
    https://aur.archlinux.org/packages/oscam-svn/   (this is a related package as it must properly execute prior to sasc-ng)
    So my server is now on a fresh Arch install with systemd. All is well (& very fast) except I cannot get sasc-ng to function with systemd service init files. Prior to systemd the system worked fine with the rc initscripts & was very stable with the following setup:
    rc.local
    /etc/rc.d/oscam start
    sleep 15
    /etc/rc.d/sasc-ng start
    sleep 4
    /etc/rc.d/mythbackend start
    /etc/conf.d/sasc-ng.conf
    SASCNG_ARGS="-j 0:3 -j 1:4 -j 2:5" -b 16M --sid-allpid --sid-nocache --cam-budget"
    DVBLOOPBACK_ARGS="num_adapters=3"
    LOGDIR="/home/mythtv/logs/"
    CAMDIR="/etc/camdir"
    /etc/camdir/cardclient.conf
    camd35:localhost:15050:1/0000/0000:mythtv:mythtv
    I'll leave out the oscam stuff as that loads fine and doesn't appear to be a part of the problem
    I've tried this with the systemd service file that comes with the open-sasc-ng-dkms package and when it was not sucessful I tried a bunch of variants including using "Type=simple" ect. "Type=Forked" seems to be only option that actually tries to start the processes. I also "hardcoded" the service files for the 2 sasc-ng components to find a few issues with the EnvironmentFile variables. The log variable has been removed for now as this seems to cause a fatal error but the rest of the variables load fine now. I also tested spliting up the DVB loopback module from the sasc-ng binary but this also gives similar results as the following script stands now. Running them manually with systemctl start commands doesn't make a difference but that is not surprising. The service file I'm fiddling with now which I feel has the best potential become working is:
    sasc-ng.service
    [Unit]
    Description=Sasc-ng
    After=oscam.service
    [Service]
    Type=forking
    EnvironmentFile=/etc/conf.d/sasc-ng
    ExecStartPre=/sbin/modprobe dvbloopback $DVBLOOPBACK_ARGS
    TimeoutSec=2
    ExecStart=/usr/sbin/sasc-ng -D $SASCNG_ARGS --cam-dir=$CAMDIR
    TimeoutSec=4
    [Install]
    WantedBy=multi-user.target
    Mythbackend always runs fine (even without DTV via sasc-ng) with the following mythbackend.service:
    [Unit]
    Description=MythTV_backend
    After=sasc-ng.service
    [Service]
    Type=simple
    Environment=MYTHCONFDIR=/etc/conf.d/mythbackend
    Environment=HOME=/usr/share/mythtv
    User=mythtv
    ExecStart=/usr/bin/mythbackend --logpath /var/log/mythtv
    [Install]
    WantedBy=multi-user.target
    oscam.service taken mostly from AUR package also seems fine. I added the TimeoutSec=15 to give time for oscam to load the SC and client protocol before moving on or else sasc-ng fails
    Unit]
    Description=An Open Source Conditional Access Module software
    After=network.target
    [Service]
    Type=forking
    EnvironmentFile=/etc/conf.d/oscam
    ExecStart=/usr/bin/oscam $OSCAM_ARGS
    TimeoutSec=15
    [Install]
    WantedBy=multi-user.target
    Below is the output of the systemctl status commands. Despite the noise in the sasc-ng binary status, it is the loopback module that is " inactive (dead)" and there are no virtual DVB devices being created:
    [mythtv@server ~]$ sudo systemctl status oscam.service
    oscam.service - An Open Source Conditional Access Module software
    Loaded: loaded (/usr/lib/systemd/system/oscam.service; enabled)
    Active: active (running) since Tue, 2012-11-27 21:10:17 CET; 1min 7s ago
    Process: 338 ExecStart=/usr/bin/oscam $OSCAM_ARGS (code=exited, status=0/SUCCESS)
    Main PID: 377 (oscam)
    CGroup: name=systemd:/system/oscam.service
    ├ 377 /usr/bin/oscam -b -c /etc/oscam
    └ 378 /usr/bin/oscam -b -c /etc/oscam
    Nov 27 21:10:17 server systemd[1]: Started An Open Source Conditional Acces...e.
    [mythtv@server ~]$ sudo systemctl status loopback.service
    loopback.service - Sasc-ng DVB Loopback Module
    Loaded: loaded (/etc/systemd/system/loopback.service; enabled)
    Active: inactive (dead) since Tue, 2012-11-27 21:10:28 CET; 1min 27s ago
    Process: 907 ExecStart=/sbin/modprobe dvbloopback num_adapters=3 (code=exited, status=0/SUCCESS)
    CGroup: name=systemd:/system/loopback.service
    Nov 27 21:10:28 server systemd[1]: Started Sasc-ng DVB Loopback Module.
    [mythtv@server ~]$ sudo systemctl status sasc-ng.service
    sasc-ng.service - Sasc-ng
    Loaded: loaded (/etc/systemd/system/sasc-ng.service; enabled)
    Active: failed (Result: exit-code) since Tue, 2012-11-27 21:10:47 CET; 1min 45s ago
    Process: 913 ExecStart=/usr/sbin/sasc-ng -D -j 0:3 -j 1:4 -j 2:5" -b 16M --sid-allpid --sid-nocache --cam-budget --cam-dir=/etc/camdir -l /home/mythtv/logs/sasc-ng.log (code=exited, status=0/SUCCESS)
    Main PID: 921 (code=exited, status=255)
    CGroup: name=systemd:/system/sasc-ng.service
    Nov 27 21:10:39 server sasc-ng[921]: [921] [general.error] failed open /etc...ry
    Nov 27 21:10:40 server sasc-ng[921]: [921] [general.error] failed open /etc...ry
    Nov 27 21:10:40 server sasc-ng[921]: [921] [general.error] failed open /etc...ry
    Nov 27 21:10:40 server sasc-ng[921]: [921] [general.info] loading cardclien...nf
    Nov 27 21:10:42 server sasc-ng[921]: [1062] Netwatcher thread started (pid=...6)
    Nov 27 21:10:42 server sasc-ng[921]: [921] [general.error] no keys loaded f...m!
    Nov 27 21:10:46 server sasc-ng[921]: [1098] SC housekeeper thread started (...2)
    Nov 27 21:10:47 server sasc-ng[921]: [1062] Netwatcher thread ended (pid=92...6)
    Nov 27 21:10:47 server systemd[1]: sasc-ng.service: main process exited, co.../a
    Nov 27 21:10:47 server systemd[1]: Unit sasc-ng.service entered failed state
    [mythtv@server ~]$ sudo systemctl status sasc-ng.service
    sasc-ng.service - Sasc-ng
    Loaded: loaded (/etc/systemd/system/sasc-ng.service; enabled)
    Active: failed (Result: exit-code) since Tue, 2012-11-27 21:10:47 CET; 2min 9s ago
    Process: 913 ExecStart=/usr/sbin/sasc-ng -D -j 0:3 -j 1:4 -j 2:5" -b 16M --sid-allpid --sid-nocache --cam-budget --cam-dir=/etc/camdir -l /home/mythtv/logs/sasc-ng.log (code=exited, status=0/SUCCESS)
    Main PID: 921 (code=exited, status=255)
    CGroup: name=systemd:/system/sasc-ng.service
    Nov 27 21:10:39 server sasc-ng[921]: [921] [general.error] failed open /etc/camdir/smartcard.conf: No such file or directory
    Nov 27 21:10:40 server sasc-ng[921]: [921] [general.error] failed open /etc/camdir/cardslot.conf: No such file or directory
    Nov 27 21:10:40 server sasc-ng[921]: [921] [general.error] failed open /etc/camdir/SoftCam.Key: No such file or directory
    Nov 27 21:10:40 server sasc-ng[921]: [921] [general.info] loading cardclient config from /etc/camdir/cardclient.conf
    Nov 27 21:10:42 server sasc-ng[921]: [1062] Netwatcher thread started (pid=921, tid=140074379712256)
    Nov 27 21:10:42 server sasc-ng[921]: [921] [general.error] no keys loaded for softcam!
    Nov 27 21:10:46 server sasc-ng[921]: [1098] SC housekeeper thread started (pid=921, tid=140074371319552)
    Nov 27 21:10:47 server sasc-ng[921]: [1062] Netwatcher thread ended (pid=921, tid=140074379712256)
    Nov 27 21:10:47 server systemd[1]: sasc-ng.service: main process exited, code=exited, status=255/n/a
    Nov 27 21:10:47 server systemd[1]: Unit sasc-ng.service entered failed state
    [mythtv@server ~]$
    Any ideas?
    Last edited by wdirksen (2012-12-10 19:54:43)

    After some head scratching it seems to be all good now. Considering there have been no replies to this I've come to wonder if I might be the only one with this issue. I could get it working somewhat using service files but never ideal, ex. sasc-ng only using a few of the entitlements from oscam because it started too quick etc. Anyway this might help a few and I'm hoping the linux savvy who find what I'm writing here painfully newbie like or flawed will reply and educate me a bit if what's provided here needs some sharpening up:
    1) Systemd was confusing the sasc-ng binary shorthand arguments with Linux init arguments and a few were misinterpreted if they were not nested into the environment specifiers. So the -l (log) was causing problems and -b (buffer) wasn't loading. To be safe I'm using only the sasc-ng longhand specifiers from now on (two "--" and more verbose) so that they can never be confused even if safely nested in an environment parameter. That means that /etc/conf.d/sasc-ng will also need to be changed to reflect this. I also decided to simplify the LOGFILE parameter to include the whole argument syntax.
    2) Oscam.service needs to be initiated with oneshot and RemainAfterExit=yes to make sure the delay (15 seconds in my config) gets counted out before sasc-ng initiates.
    [EDIT 12/12/2012: Initially I had a second TimeoutSec=2 after ExecStart in sasc-ng.service but this had no function. Turns out that it almost always does work without this delay but not always with my setup. Adding TimeoutSec=2 to mythbackend.service prior to ExecStart command does function and makes things init more consistant]
    sasc-ng.service
    [Unit]
    Description=Sasc-ng
    After=oscam.service
    [Service]
    Type=simple
    EnvironmentFile=/etc/conf.d/sasc-ng
    ExecStartPre=/sbin/modprobe dvbloopback $DVBLOOPBACK_ARGS
    TimeoutSec=2
    ExecStart=/usr/sbin/sasc-ng $SASCNG_ARGS --cam-dir $CAMDIR --log $LOGFILE
    [Install]
    WantedBy=multi-user.target
    /etc/conf.d/sasc-ng
    SASCNG_ARGS="--join 0:3 --join 1:4 --join 2:5 --buffer 16M --sid-allpid --sid-nocache --cam-budget"
    DVBLOOPBACK_ARGS="num_adapters=3"
    LOGFILE="/home/mythtv/logs/sasc-ng.log"
    CAMDIR="/etc/camdir"
    oscam.service
    [Unit]
    Description=An Open Source Conditional Access Module software
    After=network.target
    [Service]
    Type=oneshot
    EnvironmentFile=/etc/conf.d/oscam
    ExecStart=/usr/bin/oscam $OSCAM_ARGS
    TimeoutSec=15
    RemainAfterExit=yes
    [Install]
    WantedBy=multi-user.target
    mythbackend.service
    [Unit]
    Description=MythTV_backend
    After=sasc-ng.service
    [Service]
    Type=simple
    TimeoutSec=2
    Environment=MYTHCONFDIR=/etc/conf.d/mythbackend
    Environment=HOME=/usr/share/mythtv
    User=mythtv
    ExecStart=/usr/bin/mythbackend --logpath /var/log/mythtv
    [Install]
    WantedBy=multi-user.target
    I will make the related changes to the open-sasc-ng AUR package which I currently maintain
    Last edited by wdirksen (2012-12-23 14:40:43)

  • [solved]Need help with a bash script for MOC conky artwork.

    I need some help with a bash script for displaying artwork from MOC.
    Music folders have a file called 'front.jpg' in them, so I need to pull the current directory from MOCP and then display the 'front.jpg' file in conky.
    mocp -Q %file
    gives me the current file playing, but I need the directory (perhaps some way to use only everything after the last  '/'?)
    A point in the right direction would be appreciated.
    thanks, d
    Last edited by dgz (2013-08-29 21:24:28)

    Xyne wrote:
    You should also quote the variables and output in double quotes to make the code robust, e.g.
    filename="$(mocp -Q %file)"
    dirname="${filename%/*}"
    cp "$dirname"/front.jpg ~/backup/art.jpg
    Without the quotes, whitespace will break the code. Even if you don't expect whitespace in any of the paths, it's still good coding practice to include the quotes imo.
    thanks for the tip.
    here it is, anyhow:
    #!/bin/bash
    filename=$(mocp -Q %file)
    dirname=${filename%/*}
    cp ${dirname}/front.jpg ~/backup/art.jpg
    then in conky:
    $alignr${execi 30 ~/bin/artc}${image ~/backup/art.jpg -s 100x100 -p -3,60}
    thanks for the help.
    Last edited by dgz (2013-08-29 21:26:32)

  • [SOLVED] A custom systemd service doesn't execute a specific command

    I have made a custom service which should set screen brightness.
    file: /etc/systemd/system/backlight100.service
    [Unit]
    Description=Set screen brightness
    [Service]
    Type=oneshot
    ExecStart=/bin/echo 100 > /sys/class/backlight/intel_backlight/brightness
    ExecStart=/usr/bin/beep
    [Install]
    WantedBy=multi-user.target
    (beep is there so I can know for sure that the script runs)
    The problem is, when I run "# systemctl start backlight100.service" I can hear the beep but it doesn't change the brightness. When I run "/bin/echo 100 > /sys/class/backlight/intel_backlight/brightness" in terminal it does change the brightness... but not when I start or restart the service.
    Here's the output of systemctl status backlight100.service after starting it
    backlight100.service - Set screen brightness
    Loaded: loaded (/etc/systemd/system/backlight100.service; enabled)
    Active: inactive (dead) since Fri 2013-04-05 20:17:32 AMT; 3min 19s ago
    Process: 27698 ExecStart=/usr/bin/beep (code=exited, status=0/SUCCESS)
    Process: 27696 ExecStart=/bin/echo 100 > /sys/class/backlight/intel_backlight/brightness (code=exited, status=0/SUCCESS)
    Apr 05 20:17:32 work systemd[1]: Starting Set screen brightness...
    Apr 05 20:17:32 work echo[27696]: 100 > /sys/class/backlight/intel_back...ss
    Apr 05 20:17:32 work systemd[1]: Started Set screen brightness.
    What am I doing wrong here? Any help appreciated.
    Last edited by axper (2013-04-05 18:35:24)

    msthev wrote:$ man systemd.service
    ExecStart=
    Note that this setting does not directly support shell command
    lines. If shell command lines are to be used they need to be passed
    explicitly to a shell implementation of some kind. Example:
    ExecStart=/bin/sh -c 'dmesg | tac'
    Thanks, changing ExecStart line to
    ExecStart=/bin/bash -c '/bin/echo 100 > /sys/class/backlight/intel_backlight/brightness'
    solved the issue. Though I can recall seeing ExecStart lines with direct shell commands.
    Raynman wrote:
    You should look at tmpfiles.d.
    https://wiki.archlinux.org/index.php/Sy … rary_files
    I'll do that, thanks!

  • Help with systemd problems/reply to closed thread

    @Everyone; as the previopus topic was closed, I am opening a new one here, partly to reply to some things that was said to me in the previous thread/topic (and I do not like to leave people hanging), but mainly to try and get some help with my systemd config (that I was not able to find help with in the wiki or manpages).
    @czubek; eww, that sounds rather similiar to some other operating systems I've heard of (not just, but obviously including, windows)... For me, subjectively, that is not very attractive, as being able to have a single application do a single thing, and then mixing and matching as I personally see fit is a great thing.
    @tomegun: I can indeed see your point, but if I made direct quotes on all the things I reply too, my posts would reach biblical proportions.
    Mmm-hmm, I do indeed know of "the Arch Way"; however, the system that you expose can be of varying complexity as well, and I found that the system that was presented to me by way of Sysvinit/initscripts was a way simpler system than that presented to me by systemd.
    Indeed, and I do like that; I enjoy knowing how my system works and learning more about it; however, the truth is that reading manpages and the wiki isn't always enough. And I use the numbers instead of letters in certain places as a jest, please, do not get offended by that; if you have to, get offended by my opinions.
    Ah, I have now scanned the wiki, the manpages, and have already faced problems. While part of me is saddened by this fact (as I was hoping for a smooth transition to systemd), part of me is glad that I can at least prove that everything isn't quite as simple as some people would make it out to be. More on this later in this post, as I do need help with the problems I have faced.
    And I wouldn't say that the new and old way are equally trivial, as I immediatley faced problems with "the new way". More on this later.
    Ok, I find that if the debate is polarized, then there is nothing wrong with describing it as such. I spell what I see.
    Oh my... Ignored as a matter of principle? I would say that that is an excellent way to stagnate; by that logic, moviemakers, gamemakers etcetera should ignore any and all criticism they recieve, as the critics are not contributing.... Wouldn't that lead to a complete halt in development? Isn't criticism (so long as it is constructive, obviously) a key component of (media/software) evolution?
    Ah, I see, then I  misunderstood the current state of the install media
    "Some adjustements"... Well, I guess we'll have to see how that goes, then. Hopefully it'll be smooth.
    @Everyone; Awebb possesses stunning accuracy as far as his observations go.
    @zb3; My point exactly.
    @tomegun; I believe you to be wrong; complaining (but not whining) is the first step towards improvement, as I think that I and zb3 has shown.
    Further, your last point (where you talk about "deep understanding of Y" and whatnot) is basically saying that only devs and programmers can contribute, so zb3's observation would be correct.
    Also, making suggestions is part of constructive criticism; you can do that even if you can't code, e.g. by saying "X works badly because it makes Y crash; couldn't we replace X with something akin to Z?". This is a valid point even if you have no intricate understanding of X, Y or Z, and if it is impossible to replace X for one reason or the other, it's not hard to reply with "Replacing X is impossible because of reason Q", and then see if someone can solve reason Q etcetera.
    zb3's example is obviously helping; for one, it would allow people to know taht they can't boot with systemd in certain cases, or that installing/runing systemd can break their system. I would consider that rather important information.
    @Everyone; Now then, to see if I can (or rather, if I can get help to) shed some light on some problems I've been having.
    My transition to systemd went pretty smooth (besides the fact that I couldn't use 'systemctl' to set anything, and neither duckduckgo nor any posts in the forums could help me (the error I continously got was "Failed to issue method call: Launch helper exited with unknown return code 1") and that there are no manpages/tips on how to configure the files for "localtime" and "adjtime", which would've been good considering some syntax have changed) to about halfway through, to the point where I was supposed to start using systemd for my daemons.
    Now then, to the main problem; first, I tried running
    "systemctl enable syslog-ng.service"
    and got the following message;
    "ln -s '/usr/lib/systemd/system/syslog-ng.service' '/etc/systemd/system/syslog.service'
    ln -s '/usr/lib/systemd/system/syslog-ng.service' '/etc/systemd/system/multi-user.target.wants/syslog-ng.service'"
    Since it doesn't exclusively say that something went wrong (at least as far as I can understand), I pondered the message a bit, but moved on to try and start dbus by issuing
    "systemctl enable dbus.service",
    to which I got the reply
    "The unit files have no [Install] section. They are not meant to be enabled using systemctl."
    This I can only assume is an error message of some sort, especially seeing as it says "not meant to be enabled using systemctl", but the wiki rather explicitly states that that is what I am supposed to do.
    I dare not move on (or attempt to start other daemons) without further advice, as I fear I might break my system. Any ideas as to how to solve this would be greatly appreciated.

    tcmdvm wrote:
    The message;
    "ln -s '/usr/lib/systemd/system/syslog-ng.service' '/etc/systemd/system/syslog.service'
    ln -s '/usr/lib/systemd/system/syslog-ng.service' '/etc/systemd/system/multi-user.target.wants/syslog-ng.service'"
    indicates that running "systemctl enable syslog.service" is now enabled.
    If you try running sytemtctl enable <whatever>.service and get
    "The unit files have no [Install] section. They are not meant to be enabled using systemctl." means there is no <whatever>.service file available to enable.
    The dbus.service as far as I know is already enabled when installing systemd and doesn't require any action.
    Ah, right, systemd is chatty (I'm of the old skool; if nothing is/goes wrong, a program should keep quiet).
    Oh ok, then I should dare more on.
    ZekeSulastin wrote:To be a bit more precise, it means the service is there but it's only used as a dependency for something else; the [Install] section of the file is what tells systemctl where to link it and such.  Also, where exactly in the wiki were you told explicitly to 'systemctl enable dbus.service'?  I can easily point you to the sections in both installation guides that tell you how to set things like /etc/localtime et. al (also `man 7 archlinux`), but not the one that said to manually enable dbus.
    Ah, I see; and well, I was told right here, going from the top, to "Enable Daemons formerly listed in rc.conf [...] For a translation of the daemons from /etc/rc.conf to systemd services, see: List of Daemons and Services.", and, using the list, dbus is mentioned there, as you can see. Since I started from the top, I did not know that you didn't need to enable that service. Perhaps it could be added to the descriptions of the relevant services in the Wiki which ones are autostarted?
    ZekeSulastin wrote:Lastly, I don't think trying to continue conversations from a closed thread is a very good idea, let alone doing it in a giant undivided wall of text that makes it quite difficult to pick out much any single topic.
    Meh, I directly refer to the relevant people, they can easily see their own old posts in the previous thread, etcetera... I think te ones who have something to say will be able to find my replies to their previous statements (or so I hope). For now, as everyone can see, I quote stuff (but man might I make some huge posts if I ever post again in the future, if I quote what I reply to).
    fsckd wrote:This is not really a technical support subforum. Moving from Arch Discussion to Newbie Corner.
    Ah ok, thanks (or perhaps a cautious thanks? Moving it to "newbie corner" might, after all, be a subtle insult...).
    tomegun wrote:It is not really possible to follow your message as you don't quote what you are replying to. Moreover, as the thread was closed I think that means we should stop the discussion ;-)
    Hmm, I think it means cop-out for lack or proper arguments/responses... But ok, I'll let it slide, for now (mainly as I can't do much else).
    tomegun wrote:You are not meant to enable dbus.service as it is enabled unconditionally. To check the enabled/disabled state of your services try "systemctl list-unit-files". "static" means that you are not supposed to enabled/disable it.
    Ah ok, thank you. Now, having abandoned all hope, I'll start configuring again and see how it goes... May the void protect me. If I die, grieve not for me, but remember me in the fight against hard-to-configure applications.
    (edit/addon)
    Actually, what am I supposed to do with "hwclock"? the List of Daemons only says that I shouldn't run that in tandem with ntpd, but I'm not running ntpd, so... How do I get hwclock with systemd?
    Edited for additional question.
    Last edited by incassum (2012-11-07 08:44:42)

  • [Solved] postgresql with systemd

    Hello Guys,
    I'm having problems starting the postgres with systemd.
    Following errors:
    Running systemctl start postgresql
    k@archK ~ % sudo systemctl start postgresql
    Job for postgresql.service failed. See 'systemctl status postgresql.service' and 'journalctl -xn' for details.
    1 k@archK ~ %
    Running systemctl status postgresql.service got the message below:
    k@archK ~ % systemctl status postgresql.service
    postgresql.service - PostgreSQL database server
    Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled)
    Active: failed (Result: exit-code) since Sáb, 2012-12-29 19:09:19 BRT; 1min 19s ago
    Process: 1746 ExecStart=/usr/bin/pg_ctl -s -D ${PGROOT}/data start -w -t 120 (code=exited, status=1/FAILURE)
    Process: 1741 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGROOT}/data (code=exited, status=0/SUCCESS)
    CGroup: name=systemd:/system/postgresql.service
    3 k@archK ~ %
    and journalctl -xn this:
    k@archK ~ % sudo journalctl -xn
    [sudo] password for k:
    -- Logs begin at Sáb, 2012-12-29 03:47:42 BRT, end at Sáb, 2012-12-29 19:11:49 BRT. --
    Dez 29 19:09:19 archK systemd[1]: postgresql.service: control process exited, code=exited status=1
    Dez 29 19:09:19 archK systemd[1]: Failed to start PostgreSQL database server.
    -- Subject: Unit postgresql.service has failed
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    -- Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/be02cf6855d2428ba40df7e9d022f03d
    -- Unit postgresql.service has failed.
    -- The result is failed.
    Dez 29 19:09:19 archK systemd[1]: Unit postgresql.service entered failed state
    Dez 29 19:09:19 archK sudo[1738]: pam_unix(sudo:session): session closed for user root
    Dez 29 19:11:27 archK udisks-daemon[430]: **** Refreshing ATA SMART data for /sys/devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda
    Dez 29 19:11:27 archK udisks-daemon[430]: helper(pid 1781): launched job udisks-helper-ata-smart-collect on /dev/sda
    Dez 29 19:11:28 archK udisks-daemon[430]: helper(pid 1781): completed with exit code 0
    Dez 29 19:11:28 archK udisks-daemon[430]: **** EMITTING CHANGED for /sys/devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda
    Dez 29 19:11:49 archK sudo[1786]: k : TTY=pts/0 ; PWD=/home/k ; USER=root ; COMMAND=/usr/bin/journalctl -xn
    Dez 29 19:11:49 archK sudo[1786]: pam_unix(sudo:session): session opened for user root by k(uid=0)
    Here is the postgresql.service
    [Unit]
    Description=PostgreSQL database server
    After=network.target
    [Service]
    Type=forking
    TimeoutSec=120
    User=postgres
    Group=postgres
    Environment=PGROOT=/var/lib/postgres
    SyslogIdentifier=postgres
    PIDFile=/var/lib/postgres/data/postmaster.pid
    ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGROOT}/data
    ExecStart= /usr/bin/pg_ctl -s -D ${PGROOT}/data start -w -t 120
    ExecReload=/usr/bin/pg_ctl -s -D ${PGROOT}/data reload
    ExecStop= /usr/bin/pg_ctl -s -D ${PGROOT}/data stop -m fast
    # Due to PostgreSQL's use of shared memory, OOM killer is often overzealous in
    # killing Postgres, so adjust it downward
    OOMScoreAdjust=-200
    [Install]
    WantedBy=multi-user.target
    and /etc/conf.d/postgresql
    ## Parameters to be passed to postgresql
    ## Default data directory location
    PGROOT="/var/lib/postgres"
    ## Passed to initdb if necessary
    INITOPTS="--locale en_US.UTF-8"
    ## Default log file location
    #PGLOG="/var/log/postgresql.log"
    ## Additional options to pass via pg_ctl's '-o' option
    #PGOPTS=""
    Does anyone have any idea how to fix this?
    Thanks.
    Last edited by kleitonkk (2013-01-03 23:51:41)

    Sorry for the delay, was traveling and just returned yesterday.
    lothar_m was followed as described in the post, since removed the packages twice and did the install again but the same error.
    [root@archK conf.d]# systemctl start postgresql
    Job for postgresql.service failed. See 'systemctl status postgresql.service' and 'journalctl -xn' for details.
    [root@archK conf.d]#
    systemctl status postgresql.service
    ➜ ~ systemctl status postgresql.service
    postgresql.service - PostgreSQL database server
    Loaded: loaded (/usr/lib/systemd/system/postgresql.service; disabled)
    Active: failed (Result: exit-code) since Thu, 2013-01-03 18:14:43 BRT; 9min ago
    Process: 10897 ExecStart=/usr/bin/pg_ctl -s -D ${PGROOT}/data start -w -t 120 (code=exited, status=1/FAILURE)
    Process: 10892 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGROOT}/data (code=exited, status=0/SUCCESS)
    CGroup: name=systemd:/system/postgresql.service
    ➜ ~
    [root@archK conf.d]# journalctl -xn
    -- Logs begin at Wed, 2013-01-02 16:50:57 BRT, end at Thu, 2013-01-03 18:34:41 BRT. --
    Jan 03 18:25:28 archK su[11082]: pam_unix(su:session): session opened for user root by k(uid=1000)
    Jan 03 18:34:36 archK systemd[1]: Starting PostgreSQL database server...
    -- Subject: Unit postgresql.service has begun with start-up
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    -- Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/7d4958e842da4a758f6c1cdc7b36dcc5
    -- Unit postgresql.service has begun starting up.
    Jan 03 18:34:36 archK postgres[11127]: LOG: could not translate host name "localhost", service "5432" to address: Name or service not known
    Jan 03 18:34:36 archK postgres[11127]: WARNING: could not create listen socket for "localhost"
    Jan 03 18:34:36 archK postgres[11127]: FATAL: could not create any TCP/IP sockets
    Jan 03 18:34:41 archK postgres[11127]: pg_ctl: could not start server
    Jan 03 18:34:41 archK postgres[11127]: Examine the log output.
    Jan 03 18:34:41 archK systemd[1]: postgresql.service: control process exited, code=exited status=1
    Jan 03 18:34:41 archK systemd[1]: Failed to start PostgreSQL database server.
    -- Subject: Unit postgresql.service has failed
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    -- Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/be02cf6855d2428ba40df7e9d022f03d
    -- Unit postgresql.service has failed.
    -- The result is failed.
    Jan 03 18:34:41 archK systemd[1]: Unit postgresql.service entered failed state
    /usr/lib/systemd/system/postgresql.service
    [Unit]
    Description=PostgreSQL database server
    After=network.target
    [Service]
    Type=forking
    TimeoutSec=120
    User=postgres
    Group=postgres
    Environment=PGROOT=/var/lib/postgres
    SyslogIdentifier=postgres
    PIDFile=/var/lib/postgres/data/postmaster.pid
    ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGROOT}/data
    ExecStart= /usr/bin/pg_ctl -s -D ${PGROOT}/data start -w -t 120
    ExecReload=/usr/bin/pg_ctl -s -D ${PGROOT}/data reload
    ExecStop= /usr/bin/pg_ctl -s -D ${PGROOT}/data stop -m fast
    # Due to PostgreSQL's use of shared memory, OOM killer is often overzealous in
    # killing Postgres, so adjust it downward
    OOMScoreAdjust=-200
    [Install]
    WantedBy=multi-user.target
    ➜ ~ pacman -Q |grep postgres
    postgresql 9.2.2-2
    postgresql-libs 9.2.2-2
    ➜ ~
    /etc/conf.d
    ## Parameters to be passed to postgresql
    ## Default data directory location
    PGROOT="/var/lib/postgres"
    ## Passed to initdb if necessary
    INITOPTS="--locale en_US.UTF-8"
    ## Default log file location
    #PGLOG="/var/log/postgresql.log"
    ## Additional options to pass via pg_ctl's '-o' option
    #PGOPTS=""
    /usr/lib/systemd/system/postgresql.service
    [Unit]
    Description=PostgreSQL database server
    After=network.target
    [Service]
    Type=forking
    TimeoutSec=120
    User=postgres
    Group=postgres
    Environment=PGROOT=/var/lib/postgres
    SyslogIdentifier=postgres
    PIDFile=/var/lib/postgres/data/postmaster.pid
    ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGROOT}/data
    ExecStart= /usr/bin/pg_ctl -s -D ${PGROOT}/data start -w -t 120
    ExecReload=/usr/bin/pg_ctl -s -D ${PGROOT}/data reload
    ExecStop= /usr/bin/pg_ctl -s -D ${PGROOT}/data stop -m fast
    # Due to PostgreSQL's use of shared memory, OOM killer is often overzealous in
    # killing Postgres, so adjust it downward
    OOMScoreAdjust=-200
    [Install]
    WantedBy=multi-user.target
    I'm still looking for how to solve.
    Thank you.

  • Help with Custom calculation script in Acrobat 8

    Hi all, I am using acrobat 8 on OS 10.5
    I am trying to add certain fields (numbers) and then subtract another field value to give an end result.
    I don't know anything about Javascript, would anyone be able to help with any info on how I achieve this result? I can only see Add, x and average etc... nothing there for subtraction
    Thanks for any help in advance
    Swen

    This should get you started:
    >if (event) {
    // get values from two text fields
    var a = Number(this.getField('Text1').value);
    var b = Number(this.getField('Text2').value);
    // subtract the values and show it
    this.event.target.value = a - b;
    Place this in a 3d text field, as a Custom Calculation Script.

  • Help with first Adobe Script for AE?

    Hey,
    I'm trying to create a script that will allow me to set a certain number of layer markers at an even interval to mark out a song. Could someone help me troubleshoot this script? I've been working on it for ages now, and I'm about to snap. I've basically gone from HTML and CSS, to javascript and Adobe scripting in the past few hours, and I cannot figure this out for the life of me.
    I want to create a dialog with two fields, the number of markers to place, and the tempo of the song. Tempo is pretty simple, its just the number of beats per minute. The script is meant to start at a marker that I have already placed, and set a new marker at incrementing times. Its mainly to help me see what I'm trying to animate too, even if the beat is a little hard to pick up every once in a while.
    Also, is there a better way to do this? This script will help me in the long run because I will need to do this pretty often, but I'm wondering if there was something that I could not find online that would have saved me these hours of brain-jumbling?
    Thank you very much for any help you can offer.
        // Neo_Add_MultiMarkers.jsx
        //jasondrey13
        //2009-10-26
        //Adds multiple markers to the selected layer.
        // This script prompts for a certain number of layer markers to add to the selected audio layer,
        //and an optional "frames between" to set the number of frames that should be skipped before placing the next marker
        // It presents a UI with two text entry areas: a Markers box for the
        // number of markers to add and a Frames Between box for the number of frames to space between added markers.
        // When the user clicks the Add Markers button,
        // A button labeled "?" provides a brief explanation.
        function Neo_Add_MultiMarkers(thisObj)
            // set vars
            var scriptName = "Neoarx: Add Multiple Markers";
            var numberOfMarkers = "0";
            var tempo = "0";
            // This function is called when the Find All button is clicked.
            // It changes which layers are selected by deselecting layers that are not text layers
            // or do not contain the Find Text string. Only text layers containing the Find Text string
            // will remain selected.
            function onAddMarkers()
                // Start an undo group.  By using this with an endUndoGroup(), you
                // allow users to undo the whole script with one undo operation.
                app.beginUndoGroup("Add Multiple Markers");
                // Get the active composition.
                var activeItem = app.project.activeItem;
                if (activeItem != null && (activeItem instanceof CompItem)){
                    // Check each selected layer in the active composition.
                    var activeComp = activeItem;
                    var layers = activeComp.selectedLayers;
                    var markers = layers.property("marker");
                    //parse ints
                    numberOfMarkers = parseInt (numberOfMarkers);
                    tempo = parseInt (tempo);
                    // Show a message and return if there is no value specified in the Markers box.
                    if (numberOfMarkers < 1 || tempo < 1) {
                    alert("Each box can take only positive values over 1. The selection was not changed.", scriptName);
                    return;
                    if (markers.numKeys < 1)
                    alert('Please set a marker where you would like me to begin.');
                    return;
                    var beginTime = markers.keyTime( 1 );
                    var count = 1;
                    var currentTime = beginTime;
                    var addPer = tempo/60;
                    while(numberOfMarkers < count)
                    markers.setValueAtTime(currentTime, MarkerValue(count));
                    currentTime = currentTime + addPer;
                    if (count==numberOfMarkers) {
                        alert('finished!');
                        return;
                    else{
                        count++;
                app.endUndoGroup();
        // Called when the Markers Text string is edited
            function onMarkersStringChanged()
                numberOfMarkers = this.text;
            // Called when the Frames Text string is edited
            function onFramesStringChanged()
                tempo = this.text;
            // Called when the "?" button is clicked
            function onShowHelp()
                alert(scriptName + ":\n" +
                "This script displays a palette with controls for adding a given number of markers starting at a pre-placed marker, each separated by an amount of time determined from the inputted Beats Per Minute (Tempo).\n" +
                "It is designed to mark out the even beat of a song for easier editing.\n" +
                "\n" +
                "Type the number of Markers you would like to add to the currently selected layer. Type the tempo of your song (beats per minute).\n" +           
                "\n" +
                "Note: This version of the script requires After Effects CS3 or later. It can be used as a dockable panel by placing the script in a ScriptUI Panels subfolder of the Scripts folder, and then choosing this script from the Window menu.\n", scriptName);
            // main:
            if (parseFloat(app.version) < 8)
                alert("This script requires After Effects CS3 or later.", scriptName);
                return;
            else
                // Create and show a floating palette
                var my_palette = (thisObj instanceof Panel) ? thisObj : new Window("palette", scriptName, undefined, {resizeable:true});
                if (my_palette != null)
                    var res =
                    "group { \
                        orientation:'column', alignment:['fill','fill'], alignChildren:['left','top'], spacing:5, margins:[0,0,0,0], \
                        markersRow: Group { \
                            alignment:['fill','top'], \
                            markersStr: StaticText { text:'Markers:', alignment:['left','center'] }, \
                            markersEditText: EditText { text:'0', characters:10, alignment:['fill','center'] }, \
                        FramesRow: Group { \
                            alignment:['fill','top'], \
                            FramesStr: StaticText { text:'Tempo:', alignment:['left','center'] }, \
                            FramesEditText: EditText { text:'140', characters:10, alignment:['fill','center'] }, \
                        cmds: Group { \
                            alignment:['fill','top'], \
                            addMarkersButton: Button { text:'Add Markers', alignment:['fill','center'] }, \
                            helpButton: Button { text:'?', alignment:['right','center'], preferredSize:[25,20] }, \
                    my_palette.margins = [10,10,10,10];
                    my_palette.grp = my_palette.add(res);
                    // Workaround to ensure the editext text color is black, even at darker UI brightness levels
                    var winGfx = my_palette.graphics;
                    var darkColorBrush = winGfx.newPen(winGfx.BrushType.SOLID_COLOR, [0,0,0], 1);
                    my_palette.grp.markersRow.markersEditText.graphics.foregroundColor = darkColorBrush;
                    my_palette.grp.FramesRow.FramesEditText.graphics.foregroundColor = darkColorBrush;
                    my_palette.grp.markersRow.markersStr.preferredSize.width = my_palette.grp.FramesRow.FramesStr.preferredSize.width;
                    my_palette.grp.markersRow.markersEditText.onChange = my_palette.grp.markersRow.markersEditText.onChanging = onMarkersStringChanged;
                    my_palette.grp.FramesRow.FramesEditText.onChange = my_palette.grp.FramesRow.FramesEditText.onChanging = onFramesStringChanged;
                    my_palette.grp.cmds.addMarkersButton.onClick    = onAddMarkers;
                    my_palette.grp.cmds.helpButton.onClick    = onShowHelp;
                    my_palette.layout.layout(true);
                    my_palette.layout.resize();
                    my_palette.onResizing = my_palette.onResize = function () {this.layout.resize();}
                    if (my_palette instanceof Window) {
                        my_palette.center();
                        my_palette.show();
                    } else {
                        my_palette.layout.layout(true);
                else {
                    alert("Could not open the user interface.", scriptName);
        Neo_Add_MultiMarkers(this);

    You should ask such questions over at AEnhancers. I had a quick look at your code but could not find anything obvious, so it may relate to where and when you execute certain functions and how they are nested, I just don't have the time to do a deeper study.
    Mylenium

  • Help create systemd .service file for Teeworlds server

    Hi there.
    I maintain one package the provide server for the game Teeworlds (teeworlds-zcatch in AUR). I'd like to have a ".service" file to be able to run the server in background, maybe even in startup, and saving the log (it send some stuff to stdout that could be nice to keep). However I don't know how to make a ".service" script. Could somene create a script or point me out to informations about it?
    Thanks in advance

    Hi.
    https://bbs.archlinux.org/viewtopic.php … 9#p1363959
    There I explain a little a .service that I'm using. Maybe it be useful.
    And in this wikipage there are several examples
    https://wiki.archlinux.org/index.php/Systemd/Services

  • Help with web form script. PHP, CGI, Perl???

    anyone willing to help with a web form script? I have a form built, but cant seem to figure out the scripting! Should I be using Perl, CGI, PHP... What do I need to enable? I am a complete novice when it comes to scripts. Looking for a little friendly help.

    Here is a simple bit of PHP to stick in the page your form posts to. You would need to edit the first three variables to your liking, and add the html you want to serve afterwards:
    <pre>
    <?php
    $emailFrom = '[email protected]';
    $emailTo = '[email protected]';
    $emailSubject = 'Subject';
    $date = date('l, \t\h\e dS \o\f F, Y \a\t g:i A');
    $browser = $HTTPSERVER_VARS['HTTP_USERAGENT'];
    $hostname = $HTTPSERVER_VARS['REMOTEADDR'];
    $message = "$date\n\nAddress: $hostname\nBrowser: $browser\n\n";
    foreach ($_POST as $key => $value) {
    $message .= $key . ": " . $value . "\n";
    $mailResult = mail($emailTo,$emailSubject,$message,"From: $emailFrom");
    ?>
    </pre>
    This script will grab the server's date and the submitter's address and browser type. It will then list the name and value of each form field you have put on your form.
    Also, this script expects your form method="post".
    Lastly, you can offer alternate text later on in your html page based on the success of the above script with a snippet like this:
    <pre><?php
    if ($mailResult) {
    echo "Your comments have been received thank you.";
    } else {
    echo "There was an error. Please try again or contact us using an alternate method.";
    ?></pre>

  • Please help with web services (JSR 172)

    Hello!
    I'm in need of some help. I've only worked with web services some few weeks. I have two web services that I want to access from J2ME.
    Both works nice in regular Java (J2SE). I use axis so with the help of WSDL2Java I got a working client.
    One of them has four operations
        public boolean tryToLoginUser( String username, String password ) {}   
        public boolean tryToLogOffUser( String username, String password ){}
        public boolean createUserAccount( String username, String password ){ }
        public boolean removeUserAccount( String username, String password ){ } The problem is when I want to use Sun's Wireless Toolkit 2.2 and create stubs that way with the Stub Generator. It complains with this
    warning: Operation tryToLoginUser is of the wrong encoding SOAP style/use (rpc/encoded).  Document/literal only.  Skipping generation of operation.
    warning: Operation tryToLogOffUser is of the wrong encoding SOAP style/use (rpc/encoded).  Document/literal only.  Skipping generation of operation.
    warning: Operation createUserAccount is of the wrong encoding SOAP style/use (rpc/encoded).  Document/literal only.  Skipping generation of operation.
    warning: Operation removeUserAccount is of the wrong encoding SOAP style/use (rpc/encoded).  Document/literal only.  Skipping generation of operation.What I can tell is I need to put this in my axis deployment descriptor
    <service name="UserWebService" provider="java:RPC" style="document" use="literal">instead of this:
    <service name="UserWebService" provider="java:RPC">This wont work. It don't work with HTTP GET I get this error
      <?xml version="1.0" encoding="UTF-8" ?>
    - <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    - <soapenv:Body>
    - <soapenv:Fault>
      <faultcode>soapenv:Server.userException</faultcode>
      <faultstring>org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.</faultstring>
    - <detail>
      <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">slukare</ns1:hostname>
      </detail>
      </soapenv:Fault>
      </soapenv:Body>
      </soapenv:Envelope>I doesn�t work with WSDL2Java and when I run Sun's Wireless Toolkit 2.2 to generate stub it complains with
    warning: ignoring operation "tryToLoginUser": more than one part in input message
    warning: ignoring operation "tryToLogOffUser": more than one part in input message
    warning: ignoring operation "createUserAccount": more than one part in input message
    warning: ignoring operation "removeUserAccount": more than one part in input message
    warning: Port "UserWebService" does not contain any usable operationsDoes this mean I can only use one parameter for input in an operation when I use style="document" use="literal" ??
    I understood it that way, so I created a new web service that takes username and password in one String.
    The new web service has four operations
        public boolean tryToLoginUser( String usernameAndPassword ) {}   
        public boolean tryToLogOffUser( String usernameAndPassword ){}
        public boolean createUserAccount( String usernameAndPassword ){ }
        public boolean removeUserAccount( String usernameAndPassword ){ }The problem is that I get this error when running HTTP GET.
      <?xml version="1.0" encoding="UTF-8" ?>
    - <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    - <soapenv:Body>
    - <soapenv:Fault>
      <faultcode>soapenv:Server.userException</faultcode>
      <faultstring>org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.</faultstring>
    - <detail>
      <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">slukare</ns1:hostname>
      </detail>
      </soapenv:Fault>
      </soapenv:Body>
      </soapenv:Envelope>If I get a WSDL2Java client it works (!) if I manually changes the parameter names. I have four operations which all takes
    String usernameAndPassword
    in one String since I can only use one parameter with style="document" use="literal"
    The WSDL2Java automatically set the parameter names to
    usernameAndPassword
    usernameAndPassword1
    usernameAndPassword2
    usernameAndPassword3
    for the different operations. If I manually changes them to all have the name
    usernameAndPassword
    it works. Why doesn�t it work without manual changes? I haven�t tested the code from Sun�s Wireless Toolkit 2.2 Stub Generator yet, but that at least doesn�t give any errors .
    My other web service doesn�t work either if I set style="document" use="literal".
    This web service returns my own classes I have written. It works as I said previously in J2SE with WSDL2Java, but not with style="document" use="literal�. When I set this my byte[] which is returned is null when using the client from WSDL2Java, this wasn�t the case without style="document" use="literal�.
    I also get an error in Sun�s Wireless Toolkit 2.2 that byte[] is not recoigniced. This wasn�t the case with axis WSDL2Java.
    If I put this inside the axis deployment descriptor
    <deployment xmlns="http://xml.apache.org/axis/wsdd/"
             xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
           <service xmlns:j2melab2="urn:businessobject.j2melab2"
                     name="RecipeWebService" provider="java:RPC" style="document" use="literal">
              <parameter name="scope" value="session"/>
              <parameter name="className" value="j2melab2.webservices.RecipeWebService"/>
              <parameter name="allowedMethods" value="*"/>
                    <typeMapping qname="j2melab2:ArrayOfString"
                                 type="java:java.lang.String[]"
                                 serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
                                 deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
                                 encodingStyle="http://schemas.xmlsoap.org/soap/encoding"/>
                    <beanMapping qname="j2melab2:Recipe" languageSpecificType="java:j2melab2.businessobject.Recipe"/>         
                    <beanMapping qname="j2melab2:Ingredient" languageSpecificType="java:j2melab2.businessobject.Ingredient"/>         
                    <typeMapping qname="j2melab2:ArrayofIngredient"
                                 type="java:j2melab2.businessobject.Ingredient[]"
                                 serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
                                 deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
                                 encodingStyle="http://schemas.xmlsoap.org/soap/encoding"/>
                    <typeMapping qname="j2melab2:ArrayOfByte"
                                 type="byte[]"
                                 serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
                                 deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
                                 encodingStyle="http://schemas.xmlsoap.org/soap/encoding"/>                            
         </service>
    </deployment>instead of this
    <deployment xmlns="http://xml.apache.org/axis/wsdd/"
             xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
           <service xmlns:j2melab2="urn:businessobject.j2melab2"
                     name="RecipeWebService" provider="java:RPC">
              <parameter name="scope" value="session"/>
              <parameter name="className" value="j2melab2.webservices.RecipeWebService"/>
              <parameter name="allowedMethods" value="*"/>
                    <typeMapping qname="j2melab2:ArrayOfString"
                                 type="java:java.lang.String[]"
                                 serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
                                 deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
                                 encodingStyle="http://schemas.xmlsoap.org/soap/encoding"/>
                    <beanMapping qname="j2melab2:Recipe" languageSpecificType="java:j2melab2.businessobject.Recipe"/>         
                    <beanMapping qname="j2melab2:Ingredient" languageSpecificType="java:j2melab2.businessobject.Ingredient"/>         
                    <typeMapping qname="j2melab2:ArrayofIngredient"
                                 type="java:j2melab2.businessobject.Ingredient[]"
                                 serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
                                 deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
                                 encodingStyle="http://schemas.xmlsoap.org/soap/encoding"/>
         </service>
    </deployment>axis WSDL2Java won�t work anymore. And Sun�s Wireless Toolkit doesn�t work either with this. How can I get this to work with Sun�s Wireless Toolkit 2.2?
    So my questions are:
    Do I really need style=�document� use=�literal� for J2ME?
    Can I only have one parameter as input when I use style=�document� use=�literal� ?
    Why do I need to manally change the parameter names?
    How can I make Sun�s Wireless Toolkit 2.2 understand byte[] ?
    Many thanks for help :) (I have to present a solution in 1 � week to my J2ME teacher L).

    hi,
    i was wandering if you manage to successfully generate the stubs through the wireless toolkit at the end? i am currently having similar problem (i.e., trying to generate stub files based on wsdl from axis)? it seems that the WTK can only handle document/literal format, and so i change the wsdl to that. however, now it complains that it can't handle more than one input part in the message, (which is similar to the problem you had). so did you manage to find a solution to that, or J2ME simply does not support more than one arguement as the input?
    thanks in advance,
    lee

  • Help with a startup script for monitorix

    How can I deal with a perl script that doesn't acknowledge a query for pidof?
    $ ps aux | grep monitorix
    root 1089 0.0 1.2 16280 6556 ? Ss 09:54 0:00 /usr/bin/monitorix -c /etc/monitorix.conf
    So it's running... but I can't find it with pidof:
    $ pidof /usr/bin/monitorix
    Here is the /etc/rc.d/monitorix I've been using but that doesn't stop the program (since it has no PID).
    #!/bin/bash
    . /etc/rc.conf
    . /etc/rc.d/functions
    PID=`pidof -o %PPID /usr/bin/monitorix`
    MARGS="-c /etc/monitorix.conf"
    case "$1" in
    start)
    stat_busy "Starting Monitorix"
    if [ -z "$PID" ]; then
    /usr/bin/monitorix $MARGS
    fi
    if [ ! -z "$PID" -o $? -gt 0 ]; then
    stat_fail
    else
    PID=`pidof -o %PPID /usr/bin/monitorix`
    echo $PID > /var/run/monitorix.pid
    add_daemon monitorix
    stat_done
    fi
    stop)
    stat_busy "Stopping Monitorix"
    [ ! -z "$PID" ] && kill $PID &> /dev/null
    if [ $? -gt 0 ]; then
    stat_fail
    else
    rm_daemon monitorix
    else
    rm_daemon monitorix
    stat_done
    fi
    restart)
    $0 stop
    sleep 1
    $0 start
    echo "usage: $0 {start|stop|restart}"
    esac

    According to the man page, the -p flag will let you generate a PID file.
    You have a few logical errors in your rc.d script and a syntax error (double else in stop). I've been using a template similar to the below in cleaning up a few of the packages I maintain...
    #!/bin/bash
    . /etc/rc.conf
    . /etc/rc.d/functions
    pidfile=/run/monitorix.pid
    if [[ -r $pidfile ]]; then
    read -r PID < "$pidfile"
    if [[ ! -d /proc/$PID ]]; then
    # stale pidfile
    unset PID
    rm -f "$pidfile"
    fi
    fi
    args=(-c /etc/monitorix.conf -p "$pidfile")
    case "$1" in
    start)
    stat_busy "Starting Monitorix"
    if [[ -z $PID ]] && /usr/bin/monitorix "${args[@]}"; then
    add_daemon monitorix
    stat_done
    else
    stat_fail
    exit 1
    fi
    stop)
    stat_busy "Stopping Monitorix"
    if [[ $PID ]] && kill $PID &> /dev/null; then
    rm_daemon monitorix
    stat_done
    else
    stat_fail
    exit 1
    fi
    restart)
    $0 stop
    sleep 1
    $0 start
    echo "usage: $0 {start|stop|restart}"
    esac
    please also fix the PKGBUILD:
    install=('readme.install')
    This is not valid, and pacman 4 will not let you declare install as an array.
    Last edited by falconindy (2011-09-25 15:05:02)

  • [SOLVED] Problems with systemd's journal when using syslog() in C

    Hi,
    I have a problem with journalctl and syslog output within a C program:
    When I use journalctl in follow mode:
      $ journalctl -f
    and I run the folowing program in another terminal
    #include <stdio.h>
    #include <syslog.h>
    int main()
    FILE *pf;
    int i;
    /* logging made in file /var/log/syslog */
    openlog("martins",LOG_CONS,LOG_USER);
    pf = fopen("not_here","r");
    if (!pf)
    syslog(LOG_ERR | LOG_USER,"oops -- %m\n");
    return 0;
    no syslog error message appears in the journal.
    But, when I modify the programm by adding a 'sleep(1);' right before 'return 0;'
    there is a correct error message shown in the journal.
    Is this a bug in systemd? Or do I understand something wrong with systemd's journal?
    I'm actually running
    linux-3.10-12-1-lts
    systemd 207
    with a 32Bit installation
    Thanks for any hints,
    Martin
    Last edited by thesofty (2013-10-01 19:10:13)

    Now, I understand what's going on:
    1) There is an known issue about a race condition in journald when the logging process exits. In this case the message isn't assigned to the user whose process generated the message.
    2) Apparently the group of the journal files have been changed from 'adm' to 'systemd-journal' in Arch Linux around April 2013.
    But still I only have been member of 'adm' as described in the journal tutorial on http://0pointer.de/blog/projects/journalctl.html. So I  can only see syslog messages, which are correctly assigned to my own user account. The messages with the race condition, as mentioned above, have been invisible to me.
    After joining to the new right group again:
      $ sudo usermod -d G  martin systemd-journal
    I also see the syslog messaes just before exiting the process again :-).

Maybe you are looking for

  • How to export only part of animation?

    In the case of a big animation (tens of thousands of frames), is there a way to render (using Export Movie) only part of the animation, e.g. frames 100-500 and nothing more? That way, loss of time would be reduced.

  • Updating data in mulitple databases

    Hi, I have a requirement in my project to update the data in two databases, when user updates data in the screen and saves it. We are using stateless session EJB to call the DAO. The update is using normal JDBC update statement. If some thing goes wr

  • File Vault won't stop.  Makes loud noise

    When I set up my IMAC G-5 originally, I selected to us File Vault, since I didn't know any better. I haven't opted to have space recaptured for a long time. Last night when asked, I said yes. After an hour of seeing the small circle turning on the li

  • 6.0 Newbie default context failed to deploy error

              I'm using WLS 6.0 SP2 and my servlets stopped working. They were working, but           now only the console will work. I get an Error 400--Bad Request           "The request could not be understood by the server due to malformed syntax. Th

  • How to see stats for filespace usage?

    Hi. Bit of a newb to grid. Suppose we have a partiion, its called /data. I would like to see how this directory has been growing the last 3 months. Today I found a way to see how much space has been available on that directory. It gives us a good ide