Search Results

Search found 6758 results on 271 pages for 'shell exec'.

Page 54/271 | < Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >

  • Hang while starting several daemons [solved]

    - by Adrian Lang
    I’m running a Debian Squeeze AMD64 server. Target runlevel after boot is runlevel 2, which includes rsyslogd, cron, sshd and some other stuff, but not dovecot, postfix, apache2, etc. The system fails to reach runlevel 2 with several symptoms: The system hangs at trying to start rsyslogd Booting into runlevel 1 works, then login from the console works Starting rsyslogd from runlevel 1 via /etc/init.d/rsyslog hangs Starting runlevel 2 with rsyslogd disabled works But then, logging in via console fails: I get the motd, and then nothing Starting sshd from runlevel 1 succeeds But then, I cannot login via ssh. Sometimes password ssh login gives me the motd and then nothing, sometimes not even this. Trying to offer a public key seems to annoy the sshd enough to not talk to me any further. When rebooting from runlevel 1, the server hangs at trying to stop apache2 (which is not running, so this really should be trivial). Trying to stop apache2 when logged in in runleve 1 does hang as well. And that’s just the stuff which fails all the time. RAM has been tested, dmesg shows no problems. I have no clue. Update: (shortened) output from rsyslogd -c4 -d called in runlevel 1 rsyslogd 4.6.4 startup, compatibility mode 4, module path '' caller requested object 'net', not found (iRet -3003) Requested to load module 'lmnet' loading module '/user/lib/rsyslog/lmnet.so' module of type 2 being loaded conf.c requested ref for 'lmnet', refcount 1 rsylog runtime initialized, version 4.6.4, current users 1 syslogd.c requested ref for 'lmnet', refcount now 2 I can kill rsyslogd with Strg+C, then. /var/log shows none of the configured log files, though. Update2: Thanks to @DerfK I still have no clue, but at least I narrowed down the problem. I’m now testing with /etc/init.d/apache2 stop (without an apache2 running, of course) which hangs as well and looks like an even more obvious failure. After some testing I found out that a file with one single line: /usr/sbin/apache2ctl configtest /dev/null 2&1 hangs, while the same line executed in an interactive shell works. I was not able to further reduce this line while, i. e. every single part, the stream redirections and the commando itself is necessary to reproduce the hang. @DerfK also pointed me to strace which gave a shallow hint about what kind of hang we have here: wait4(-1for the init scripts futex(0xsomepointer, FUTEX_WAIT_PRIVATE, 2, NULL for rsyslogd / apache2 binaries called by the init scripts The system was installed as a Debian Lenny by my hoster in autumn 2011, I upgraded it to Squeeze immediately and kept it up to date with Squeeze, which then used to be testing. There were no big changes, though. I guess I never tried to reboot the system before. Update3: I found the problem. My /etc/nsswitch.conf specified ldap as hosts lookup backup, which is not available at that time of the boot. Relying on dns solely fixes my boot problems.

    Read the article

  • Hang while starting several daemons

    - by Adrian Lang
    I’m running a Debian Squeeze AMD64 server. Target runlevel after boot is runlevel 2, which includes rsyslogd, cron, sshd and some other stuff, but not dovecot, postfix, apache2, etc. The system fails to reach runlevel 2 with several symptoms: The system hangs at trying to start rsyslogd Booting into runlevel 1 works, then login from the console works Starting rsyslogd from runlevel 1 via /etc/init.d/rsyslog hangs Starting runlevel 2 with rsyslogd disabled works But then, logging in via console fails: I get the motd, and then nothing Starting sshd from runlevel 1 succeeds But then, I cannot login via ssh. Sometimes password ssh login gives me the motd and then nothing, sometimes not even this. Trying to offer a public key seems to annoy the sshd enough to not talk to me any further. When rebooting from runlevel 1, the server hangs at trying to stop apache2 (which is not running, so this really should be trivial). Trying to stop apache2 when logged in in runleve 1 does hang as well. And that’s just the stuff which fails all the time. RAM has been tested, dmesg shows no problems. I have no clue. Update: (shortened) output from rsyslogd -c4 -d called in runlevel 1 rsyslogd 4.6.4 startup, compatibility mode 4, module path '' caller requested object 'net', not found (iRet -3003) Requested to load module 'lmnet' loading module '/user/lib/rsyslog/lmnet.so' module of type 2 being loaded conf.c requested ref for 'lmnet', refcount 1 rsylog runtime initialized, version 4.6.4, current users 1 syslogd.c requested ref for 'lmnet', refcount now 2 I can kill rsyslogd with Strg+C, then. /var/log shows none of the configured log files, though. Update2: Thanks to @DerfK I still have no clue, but at least I narrowed down the problem. I’m now testing with /etc/init.d/apache2 stop (without an apache2 running, of course) which hangs as well and looks like an even more obvious failure. After some testing I found out that a file with one single line: /usr/sbin/apache2ctl configtest /dev/null 2&1 hangs, while the same line executed in an interactive shell works. I was not able to further reduce this line while, i. e. every single part, the stream redirections and the commando itself is necessary to reproduce the hang. @DerfK also pointed me to strace which gave a shallow hint about what kind of hang we have here: wait4(-1for the init scripts futex(0xsomepointer, FUTEX_WAIT_PRIVATE, 2, NULL for rsyslogd / apache2 binaries called by the init scripts The system was installed as a Debian Lenny by my hoster in autumn 2011, I upgraded it to Squeeze immediately and kept it up to date with Squeeze, which then used to be testing. There were no big changes, though. I guess I never tried to reboot the system before.

    Read the article

  • cd Command Linux and Mystery Flags

    - by Jason R. Mick
    Platform: CentOS 6.2 Shell:tcsh I'm playing around with cd for a BASH script, and noticed the wondrous cd - option, but was left with many questions... Why the cd -? Isn't this redundant with cd ..? EDIT [As FatalError points out, these two commands don't do the same things... so the answer is "no"] Can you delve farther back into your history with - flag, a la in a browser? e.g. When I type cd -, it takes me to my previous directory, but then if I enter that command again, it takes me to the directory I just came from, creating a sort of loop. Is a shorthand for going back multiple levels supported?EDITI realize I can go back with cd .., but was hoping this could be a gateway to a less verbose deep back, e.g. cd -3 vs. cd ../../../ ... hopefully that clarifies what I'm asking....EDIT2As to the current feedback, while .. is a special directory, I don't see a reason why the built-in cd to the terminal couldn't use a shorthand for ../../ ... ../ e.g. cd ..5 or why the built-in also couldn't have a history (a la auto pushd/popd) that could be turned on and used like cd -3. I get that this could be somewhat of security/privacy risk, but I don't see how it's any worst than storing a command history, which most shells/terminals do. The manpage for cd, accessible via man cd and help cd (it's the same for either command), only lists -L and -P flags. However when I type in cd --help it outputs Usage: cd [-plvn][-|<dir>].. Am I right in assuming the other flags and the - (back) option are nonstandard? What are the -n and -v flags for? Both seem to take me back to my home directory, that's all I've been able to figure out via experimentation. A quick read on web resources [1][2] offered just the same sort of info that the man page did and didn't answer my questions. Note: The second Linux-centric resource above claimed cd only had two options (obviously not true in current CentOS) hence my assumption that this functionality could be non-standard.

    Read the article

  • Printing Stdout In Command Line App Without Overwriting Pending User Input

    - by Chris S
    In a basic Unix-shell app, how would you print to stdout without disturbing any pending user input. e.g. Below is a simple Python app that echos user input. A thread running in the background prints a counter every 1 second. import threading, time class MyThread( threading.Thread ): running = False def run(self): self.running = True i = 0 while self.running: i += 1 time.sleep(1) print i t = MyThread() t.daemon = True t.start() try: while 1: inp = raw_input('command> ') print inp finally: t.running = False Note how the thread mangles the displayed user input as they type it (e.g. hell1o wo2rld3). How would you work around that, so that the shell writes a new line while preserving the line the user's currently typing on?

    Read the article

  • Resources to learn sh scripting 'just like a normal programming language'

    - by Homer J. Simpson
    Hi, what is the best resource (book would be nice) to learn sh scripting (the "standard" shell on Unix systems) just like when i would learn a "normal" programming/scripting language ? There are lots of tutorials on certain aspects of shell scripting, they mostly deal with shells in general and unix commands and so on, but i would rather like to find a more general approach - meaning a quick syntactic overview and an outlook on how to do things you normally do when programming, like implementing small algorithms and so on. Doing actual scripting, not just a structured batch file. And rather 100-liners than 1-to-3-liners. Can you recommend a good standard book on the topic ?

    Read the article

  • Using commands with ApplicationBarMenuItem and ApplicationBarButton in Windows Phone 7

    - by Laurent Bugnion
    Unfortunately, in the current version of the Windows Phone 7 Silverlight framework, it is not possible to attach any command on the ApplicationBarMenuItem and ApplicationBarButton controls. These two controls appear in the Application Bar, for example with the following markup: <phoneNavigation:PhoneApplicationPage.ApplicationBar> <shell:ApplicationBar x:Name="MainPageApplicationBar"> <shell:ApplicationBar.MenuItems> <shell:ApplicationBarMenuItem Text="Add City" /> <shell:ApplicationBarMenuItem Text="Add Country" /> </shell:ApplicationBar.MenuItems> <shell:ApplicationBar.Buttons> <shell:ApplicationBarIconButton IconUri="/Resources/appbar.feature.video.rest.png" /> <shell:ApplicationBarIconButton IconUri="/Resources/appbar.feature.settings.rest.png" /> <shell:ApplicationBarIconButton IconUri="/Resources/appbar.refresh.rest.png" /> </shell:ApplicationBar.Buttons> </shell:ApplicationBar> </phoneNavigation:PhoneApplicationPage.ApplicationBar> This code will create the following UI: Application bar, collapsed Application bar, expanded ApplicationBarItems are not, however, controls. A quick look in MSDN shows the following hierarchy for ApplicationBarMenuItem, for example: Unfortunately, this prevents all the mechanisms that are normally used to attach a Command (for example a RelayCommand) to a control. For example, the attached behavior present in the class ButtonBaseExtension (from the Silverlight 3 version of the MVVM Light toolkit) can only be attached to a DependencyObject. Similarly, Blend behaviors (such as EventToCommand from the toolkit’s Extras library) needs a FrameworkElement to work. Using code behind The alternative is to use code behind. As I said in my MIX10 talk, the MVVM police will not take your family away if you use code behind (this quote was actually suggested to me by Glenn Block); the code behind is there for a reason. In our case, invoking a command in the ViewModel requires the following code: In MainPage.xaml: <shell:ApplicationBarMenuItem Text="My Menu 1" Click="ApplicationBarMenuItemClick"/> In MainPage.xaml.cs private void ApplicationBarMenuItemClick( object sender, System.EventArgs e) { var vm = DataContext as MainViewModel; if (vm != null) { vm.MyCommand.Execute(null); } } Conclusion Resorting to code behind to bridge the gap between the View and the ViewModel is less elegant than using attached behaviors, either through an attached property or through a Blend behavior. It does, however, work fine. I don’t have any information if future changes in the Windows Phone 7 Application Bar API will make this easier. In the mean time, I would recommend using code behind instead.   Laurent Bugnion (GalaSoft) Subscribe | Twitter | Facebook | Flickr | LinkedIn

    Read the article

  • Birt 2.5.2 report generates empty table data when run from a cron job

    - by Trueblood
    I've got a shell script that runs genReport.sh in order to create a .pdf formatted report, and it works perfectly when it's run from the command line. The data source for the report is a ClearQuest database. When it's run from a CRON job the .pdf file is created, except that only the various report and column headers are displayed, and the data of the report is missing. There are no errors reported to STDERR during the execution of the script. This screams "environment variable" to me. Currently, the shell script is defining the following: CQ_HOME BIRT_HOME ODBCINI ODBCINST LD_LIBRARY_PATH If it's an environmental thing, what part of the environment am I missing?

    Read the article

  • How do i use RVM w/ Hudson CI server on Debian?

    - by JoshReedSchramm
    I'm trying to setup an automated "build" server for my rails projects using Hudson CI. SO far it's able to run specs and do metrics on the code but I have 2 different projects dependent on 2 different versions of ruby. So i'm trying to use RVM to run multiple copies of ruby then switch back and forth in a pre-build step. I found a couple posts like this one that try and explain how to make this work, but I'm not running a startup script for hudson, it starts on boot which is how it worked out of the box when i installed it via the debian instructions. The problem seems to be that even though hudson runs under the "hudson" account and that account has rvm installed (and working) when it tries to run a shell based prebuild step to call rvm switch 1.8.7 it fails with the error "rvm: command not found" Not sure what I'm doing wrong. Hudson is using SH as its shell but i also tried using bash. no luck. Has anyone gotten this working before in this setup?

    Read the article

  • Other users on my Server?

    - by Jennifer Weinberg
    I'm buying a Server from a person (that I don't know really well) and I want to make sure that the previous owner hasn't got any access anymore. It's an Ubuntu Virtual Server and I already received the admin access (via shell). How can I find out if there are still other accounts left, who are still able to access my server (e.g. with a still existing shell account, ftp or another type of user account)? And how can I delete them if these accounts exist? Best regards, Jennifer

    Read the article

  • How do I launch a subprocess in C# with an argv? (Or convert agrv to a legal arg string)

    - by lucas
    I have a C# command-line application that I need to run in windows and under mono in unix. At some point I want to launch a subprocess given a set of arbitrary paramaters passed in via the command line. For instance: Usage: mycommandline [-args] -- [arbitrary program] Unfortunately, System.Diagnostics.ProcessStartInfo only takes a string for args. This is a problem for commands such as: ./my_commandline myarg1 myarg2 -- grep "a b c" foo.txt In this case argv looks like : argv = {"my_commandline", "myarg1", "myarg2", "--", "grep", "a b c", "foo.txt"} Note that the quotes around "a b c" are stripped by the shell so if I simply concatenate the arguments in order to create the arg string for ProcessStartInfo I get: args = "my_commandline myarg1 myarg2 -- grep a b c foo.txt" Which is not what I want. Is there a simple way to either pass an argv to subprocess launch under C# OR to convert an arbitrary argv into a string which is legal for windows and linux shell? Any help would be greatly appreciated.

    Read the article

  • Auto SSH and execute script

    - by rohanbk
    I have roughly 12 computers that each have the same script on them. This script merely pings all the other machines, and prints out whether the machine is "reachable" or "unreachable". However, it is inefficient to login to each machine manually using ssh to execute this script. Suppose I'm logged into node 1. Is there any way to for me to login to node 2-12 automatically using SSH, execute the ping script, pipe the results to a file, logout and proceed to the next machine? Some kind of bash shell script? I'm afraid I'm at a loss here since I haven't had experience with shell-scripting before.

    Read the article

  • Is it bad practice to use python's getattr extensively?

    - by Wilduck
    I'm creating a shell-like environment. My original method of handleing user input was to use a dictionary mapping commands (strings) to methods of various classes, making use of the fact that functions are first class objects in python. For flexibility's sake (mostly for parsing commands), I'm thinking of changing my setup such that I'm using getattr(command), to grab the method I need and then passing arguments to it at the end of my parser. Another advantage of this approach is not having to update my (currently statically implemented) command dictionary every time I add a new method/command. My question is, will I be taking a hit to the efficiency of my shell? Does it matter how many methods/commands I have? I'm currently looking at 30 some commands, which could eventually double.

    Read the article

  • How can I find out the original username a process was started with?

    - by szabgab
    There is a perl script that needs to run as root but the we must make sure the user who runs the script did not log-in originally as user foo as it will be removed during the script. So how can I find out if the user, who might have su-ed several times since she logged in has not impersonated 'foo' at any time in that chain? I found an interesting perl script that was calling the following two shell scripts, but I think that would only work on Solaris. my $shell_paren = `ps -ef | grep -v grep | awk \'{print \$2\" \"\$3}\' | egrep \"^@_\" | awk \'{print \$2}'`; my $parent_owner = `ps -ef | grep -v grep | awk \'{print \$1\" \"\$2}\' | grep @_ | awk \'{print \$1}\'`; This needs to work on both Linux and Solaris and I'd rather eliminate the repeated calls to he the shell and keep the whole thing in Perl.

    Read the article

  • How do I change my current directory from a python script?

    - by misterloogs
    I'm trying to implement my own version of the 'cd' command that presents the user with a list of hard-coded directories to choose from, and the user has to enter a number corresponding to an entry in the list. The program, named my_cd.py for now, should then effectively 'cd' the user to the chosen directory. Example of how this should work: /some/directory $ my_cd.py 1) ~ 2) /bin/ 3) /usr Enter menu selection, or q to quit: 2 /bin $ Currently, I'm trying to 'cd' using os.chdir('dir'). However, this doesn't work, probably because my_cd.py is kicked off in its own child process. I tried wrapping the call to my_cd.py in a sourced bash script named my_cd.sh: #! /bin/bash function my_cd() { /path/to/my_cd.py } /some/directory $ . my_cd.sh $ my_cd ... shows list of dirs, but doesn't 'cd' in the interactive shell Any ideas on how I can get this to work? Is it possible to change my interactive shell's current directory from a python script?

    Read the article

  • perl script grabbing environment vars from "someplace else"

    - by Michael Wilson
    On a Solaris box in a "mysterious production system" I'm running a perl script that references an environment variable. No big deal. The contents of that variable from the shell both pre and post execution are what I expect. However, when reported by the script, it appears as though it's running in some other sub-shell which is clobbering my vars with different values for the duration of the script. Unfortunately I really can't paste the code. I'm trying to get an atomic case, but I'm at my wit's end here. Thoughts?

    Read the article

  • How to copy files from local machine to server using SSH file transfer protocol?

    - by morpheous
    I have an Ubuntu 9.10 desktop machine which I use locally. I am setting up a server on a hosting provider. The server will run a very minimal version of Ubuntu server LTS (only LAMP and email server no GUI). I want to write a script (scheduled as a cron job) that will allow me to upload local files onto the server. I want to use [SFTP][1], for security reasons. I am new to shell scripting - but I guess shell scripting is the way to do this (unless I am mistaken). Can anyone provide me with the initial pointers on how to go about writing such a script, in order to SECURELY upload local files to the server? Ideally, I would like to compress the files before the transfer (to save on bandwidth) [1]: http://SSH file transfer protocol

    Read the article

  • What causes this error..please run "exec sp_register_custom_scripting 'CUSTOM_SCRIPT', your_script???

    - by larryr
    Configuration SQL 2005 (Server A) replicates to SQL 2008(Server B) which replicates to SQL 2008(Server C). I recently added a column (to Server A) to a replicated table via script & the DDL change replicated to Server B with out a problem. When the DDL change replicated to Server C, I received the error below. 'DDL replication failed to refresh custom procedures, please run "exec sp_register_custom_scripting 'CUSTOM_SCRIPT', your_script, 'EDI from xx', 'table_name_here' "and try again (Source: MSSQLServer, Error number: 21814)' These subscriptions (on Server B to Server C) were created via a script below. **exec sp_addsubscription @publication = N'EDI to XLOCX', @subscriber = N'RXLOCXS-SQLA', @destination_db = N'EDI', @subscription_type = N'Push', @sync_type = N'replication support only', @article = N'all', @update_mode = N'read only', @subscriber_type = 0 exec sp_addpushsubscription_agent @publication = N'EDI to XLOCX (Merge)', @subscriber = N'RXLOCXS-SQLA', @subscriber_db = N'EDI', @job_login = N'ROUSES.COM\RXLOCXSQLREPL', @job_password = N'XPASSWORDX', @subscriber_security_mode = 1, @frequency_type = 4, @frequency_interval = 1, @frequency_relative_interval = 1, @frequency_recurrence_factor = 1, @frequency_subday = 8, @frequency_subday_interval = 1, @active_start_time_of_day =3300, @active_end_time_of_day = 235959, @active_start_date = 20070923, @active_end_date = 99991231, @enabled_for_syncmgr = N'False', @dts_package_location = N'Distributor'** GO So the million dollar question is, why do I get the error 'exec sp_register_custom_scripting 'CUSTOM_SCRIPT', your_script' when I add a column to a table in the EDI to XLOCX publication??? AHIA, LarryR...

    Read the article

  • How to replace the char '[' etc with '\[' using "sed" in a file ?

    - by Abhijeet
    I have a file say "file.txt" with following contents: Capsule arr**[**0**]** in state A rate_ul/dl=**(**2000000/7000000**)** Capsule RBx**[**0**]** in state ... ... using sed operator how can i replace all occurences of '[' with '[', '(' with '(', ']' with ']' and so on. Capsule arr**\[**0**\]** in state A rate_ul/dl=**\(**2000000/7000000**\)** Capsule RBx**\[**0**\]** in state ... ... Using the substitue operator in "gvim" I am able to achieve the same result. ie. if i use ":1,$ s/\[/\\[/g" in the vi editor in command mode I see all the '[' chars replaced with '['. However if I try to use the same substitue command in a shell script using a sed command, i am not able to achieve the same result. ie If i use the following command in a shell script I am not able to achieve the desired result: sed "s/\[/\\[/g" $temp_file2 > $temp_file1 where $temp_file2 conatins the lines with '[' characters and $temp_file1 should contain the replaced '\[' chars

    Read the article

  • Php exec() return code is -1 when in a forked process, but 0 in a normal script

    - by fb1
    I am using exec() inside a a script that runs as a daemon and forks child processes using the pear class Net_Server. I am getting a strange issue whereby the return code (the third param of of exec) comes back as -1. When I run the command on the command line, or with exec in a normal php script the return code is 0 as it should be. Anyone have any idea why this is happening, and how to fix it?

    Read the article

  • read variables from file

    - by TonyVipros
    Hi, I'm trying to write a shell script to backup websites, I've got it to go through each directory in vhosts and create a new directory vhosts/{siteurl}/private/backups/ and gzip up the site into there. However, I also want it to read a file from private that will contain database name, user and password. So I can then use these to perform a mysqldump to private/backups/. The problem is that I've never written a shell script before so I've go no idea how to read variable data into my script, or how I should format the file to be read. Hope that's enough information.

    Read the article

  • CakePHP Shell issue with my directory structure

    - by keslert
    I have structured my Cake files in the following way /cakes /2_3 /app /Console /cake.php /apps /www.website1.com /Console /HelloShell.php /Controllers /etc... /www.website2.com /Console /Controllers /etc... I am getting an error "Error: Shell class HelloShell could not be found." I have added "cakes/2_3/app/Console" to my PATH, and I am running cake from inside www.website1.com. Current Paths: -app: www.website1.com -working: apps\www.website1.com -root: apps -core: cakes\2_3\lib Any ideas on what I am doing wrong?

    Read the article

  • msysgit bash shell- how to troubleshoot "cannot find command"

    - by Frank Schwieterman
    I need help getting git extensions to run with msysgit. I have had bad luck with extensions git-tfs and git-fetchall, in both cases it is the same problem. The addon will require a file to be placed where git can find it (git-tfs.exe and git-fetchall.sh). I understand this to mean the files need to be in a directory that is in the 'PATH' environment variable. In both cases I get stuck at this point: $ git-diffall bash: git-diffall: command not found or: $ git-tfs bash: git-tfs: command not found When I run echo %PATH% from a regular command shell, it shows my path variable includes the directories where git-diffall and git-tfs are. How can I debug this, or am I missing something? Is there a way within msysgit to verify the command search path is what I expect?

    Read the article

  • expr non-numeric argument shell script

    - by Kimi
    The below check is not working : expr non-numeric argument shell script. Always it is going to else. Please tell me what is the mistake. Earlier I was no using while so the same thing was woring fine now suddenly when I did put it in the while loop it is no working. echo "`${BOLD}` ***** Checking Memory Utilization User*****`${UNBOLD}`" echo "===================================================" IFS='|' cat configMachineDetails.txt | grep -v "^#" | while read MachineType UserName MachineName do export MEMORY_USAGE1=`ssh -f -T ${UserName}@${MachineName} prstat -t -s rss 1 2 | tr '%' ' '| awk '$5>5.0'` export LEN=`echo "$MEMORY_USAGE1"|wc -l` export CNPROC=`echo "$MEMORY_USAGE1"|grep "NPROC"|wc -l` export CTotal=`echo "$MEMORY_USAGE1"|grep "Total"|wc -l` **if [ $LEN = `expr $CNPROC + $CTotal` ] then echo "`${BOLD}`**************All usages are normal !!!!!! *************`${UNBOLD}`" else echo "`${BOLD}`**** Memory(%) is more than 5% in MachineType $MachineType UserName $UserName MachineName $MachineName *******`${UNBOLD}`" echo "====================================================" echo "$MEMORY_USAGE1" fi** done

    Read the article

< Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >