Sponsored Content
Top Forums UNIX for Dummies Questions & Answers [SOLVED] How can i control the same app in two servers? Post 302697589 by RudiC on Friday 7th of September 2012 04:36:30 AM
Old 09-07-2012
The lockfile's sheer existence is the indicator that the app is running. You can leave it empty, or you can put some info about the running instance of your app into it like PID, start time, user, server it runs on, so it can be used for other administrative tasks as well. You have to make sure it disappears once the app stops, even if it is, say, aborted or terminated by a signal.
 

8 More Discussions You Might Find Interesting

1. Programming

Deadlocked App

Hello All - We have a legacy C program running non stop on one of our servers, with several instances often running at once. Fairly regularly, one of the instances while stop outputting to the log file and will just deadlock/hang. They must be then 'kill'ed by myself. When I gdb into one of... (3 Replies)
Discussion started by: markanderson
3 Replies

2. Solaris

luminis app

The guys at SunGard want to charge a lot of $$$$ for installing Luminis and we are trying to see if this can be done without them. Their installation guide provided page #53 ( http://www.luminis.nocccd.edu/documents/Luminis%20IV/lp40000in.pdf ) doesn't really tell you much. All they say is that... (4 Replies)
Discussion started by: ceci1
4 Replies

3. Red Hat

userid with nothing to do on the os/app

Hi All, I got this userid apache with the same userid and groupid and /sbin/nologin and the /www/a home folder is empty. Can I just delete this userid? How can I investigate if userid have something to do with the application? Thanks for any comment you may add. (1 Reply)
Discussion started by: itik
1 Replies

4. Shell Programming and Scripting

[solved] merging two files and writing to another file- solved

i have two files as file1: 1 2 3 file2: a b c and the output should be: file3: 1~a 2~b 3~c (1 Reply)
Discussion started by: mlpathir
1 Replies

5. Emergency UNIX and Linux Support

[Solved] DCMU (disk control and monitor utility) sun fire

Hi , during 2 weeks i´ve been trying to find them. i need DCMU packets for managing internal disks on sun fire x4500 and sun fire x4600 on rhel. i have opened to tickets to myoraclesupport but no answer. please anybody could tell me a link or anythiing?? i´ve been searching and searching... (1 Reply)
Discussion started by: pabloli150
1 Replies

6. Solaris

Problem with /app

Hi folks, i have a problem with my /app directory on solaris 10.It is mounted under rpool root and sometimes it increase dimension bringing root out of space.I want to mount /app under different position, maybe under secondary hardisk for which i have created a mount point with zfs pool...How... (10 Replies)
Discussion started by: mattpunk
10 Replies

7. UNIX for Dummies Questions & Answers

[Solved] Removing control-m characters from shell script

Hi All, I need to remove control m character from a file. Steps which i am doing in shell script are: 1) We are comparing the header of the file to the database table header Here the file header has control-m characters. How do i remove it. Please help. Below are the steps i am using,... (12 Replies)
Discussion started by: abhi_123
12 Replies

8. Programming

Wuhan Coronavirus Status App for China - Rapid Prototype using MQTT and the IoT OnOff IOS App

With a little bit of work, was able to build a nice "Wuhan Coronavirus Status" app using MQTT and the IoT-OnOff app. More on this technique here: ESP32 (ESP-WROOM-32) as an MQTT Client Subscribed to Linux Server Load Average Messages The result turned out nice, I think. I like the look and... (10 Replies)
Discussion started by: Neo
10 Replies
Gtk2::UniqueApp(3pm)					User Contributed Perl Documentation				      Gtk2::UniqueApp(3pm)

NAME
Gtk2::UniqueApp - Base class for singleton applications SYNOPSIS
my $app = Gtk2::UniqueApp->new( "org.example.UnitTets", undef, foo => $COMMAND_FOO, bar => $COMMAND_BAR, ); if ($app->is_running) { # The application is already running, send it a message $app->send_message_by_name('foo', text => "Hello world"); } else { my $window = Gtk2::Window->new(); my $label = Gtk2::Label->new("Waiting for a message"); $window->add($label); $window->set_size_request(480, 120); $window->show_all(); $window->signal_connect(delete_event => sub { Gtk2->main_quit(); return TRUE; }); # Watch the main window and register a handler that will be called each time # that there's a new message. $app->watch_window($window); $app->signal_connect('message-received' => sub { my ($app, $command, $message, $time) = @_; $label->set_text($message->get_text); return 'ok'; }); Gtk2->main(); } DESCRIPTION
Gtk2::UniqueApp is the base class for single instance applications. You can either create an instance of UniqueApp via "Gtk2::UniqueApp->new()" and "Gtk2::UniqueApp->_with_commands()"; or you can subclass Gtk2::UniqueApp with your own application class. A Gtk2::UniqueApp instance is guaranteed to either be the first running at the time of creation or be able to send messages to the currently running instance; there is no race possible between the creation of the Gtk2::UniqueApp instance and the call to "Gtk2::UniqueApp::is_running()". The usual method for using the Gtk2::UniqueApp API is to create a new instance, passing an application-dependent name as construction-only property; the "Gtk2::UniqueApp:name" property is required, and should be in the form of a domain name, like org.gnome.YourApplication. After the creation, you should check whether an instance of your application is already running, using "Gtk2::UniqueApp::is_running()"; if this method returns "FALSE" the usual application construction sequence can continue; if it returns "TRUE" you can either exit or send a message using Gtk2::UniqueMessageData and "Gtk2::UniqueMessageData::send_message()". You can define custom commands using "Gtk2::UniqueApp::add_command()": you need to provide an arbitrary integer and a string for the command. HIERARCHY
Glib::Object +----Gtk2::UniqueApp METHODS
uniqueapp = Gtk2::UniqueApp->new ($name, $startup_id, ...) o $name (string) o $startup_id (string or undef) o ... (list) Creates a new Gtk2::UniqueApp instance for name passing a start-up notification id startup_id. The name must be a unique identifier for the application, and it must be in form of a domain name, like org.gnome.YourApplication. If startup_id is "undef" the DESKTOP_STARTUP_ID environment variable will be check, and if that fails a "fake" startup notification id will be created. Once you have created a Gtk2::UniqueApp instance, you should check if any other instance is running, using "Gtk2::UniqueApp::is_running()". If another instance is running you can send a command to it, using the "Gtk2::UniqueApp::send_message()" function; after that, the second instance should quit. If no other instance is running, the usual logic for creating the application can follow. uniqueapp = Gtk2::UniqueApp->new_with_commands ($name, $startup_id, ...) o $name (string) o $startup_id (string or undef) o ... (list) An alias for "Gtk2::UniqueApp->new()". $app->add_command ($command_name, $command_id) o $command_name (string) o $command_id (integer) Adds command_name as a custom command that can be used by app. You must call "Gtk2::UniqueApp::add_command()" before "Gtk2::UniqueApp::send_message()" in order to use the newly added command. The command name is used internally: you need to use the command's logical id in "Gtk2::UniqueApp::send_message()" and inside the message- received signal. boolean = $app->is_running Checks whether another instance of app is running. uniqueresponse = $app->send_message ($command, ...) o $command (scalar) o ... (list) Same as "Gkt2::UniqueApp::send_message_by_name()", but uses a message id instead of a name. uniqueresponse = $app->send_message_by_name ($command, ...) o $command (scalar) o ... (list) Sends command to a running instance of app. If you need to pass data to the instance, you have to indicate the type of message that will be passed. The accepted types are: text A plain text message data Rad data filename A file name uris URI, multiple values can be passed The running application will receive a message-received signal and will call the various signal handlers attach to it. If any handler returns a "Gtk2::UniqueResponse" different than "ok", the emission will stop. Usages: $app->send_message_by_name(write => data => $data); $app->send_message_by_name(greet => text => "Hello World!"); $app->send_message_by_name(open => uris => 'http://search.cpan.org/', 'http://www.gnome.org/', ); NOTE: If you prefer to use an ID instead of a message name then use the function "Gkt2::UniqueApp::send_message()". The usage is the same as this one. $app->watch_window ($window) o $window (Gtk2::Window) Makes app "watch" a window. Every watched window will receive startup notification changes automatically. PROPERTIES
'is-running' (boolean : default false : readable / private) Whether another instance is running 'name' (string : default undef : readable / writable / construct-only / private) The unique name of the application 'screen' (Gtk2::Gdk::Screen : default undef : readable / writable / construct / private) The GdkScreen of the application 'startup-id' (string : default undef : readable / writable / construct-only / private) The startup notification id for the application SIGNALS
Gtk2::UniqueResponse = message-received (Gtk2::UniqueApp, integer, Gtk2::UniqueMessageData, Glib::UInt) ENUMS AND FLAGS
enum Gtk2::UniqueResponse o 'invalid' / 'UNIQUE_RESPONSE_INVALID' o 'ok' / 'UNIQUE_RESPONSE_OK' o 'cancel' / 'UNIQUE_RESPONSE_CANCEL' o 'fail' / 'UNIQUE_RESPONSE_FAIL' o 'passthrough' / 'UNIQUE_RESPONSE_PASSTHROUGH' SEE ALSO
Gtk2::Unique, Glib::Object COPYRIGHT
Copyright (C) 2009-2010 by Emmanuel Rodriguez perl v5.14.2 2011-11-16 Gtk2::UniqueApp(3pm)
All times are GMT -4. The time now is 10:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy