8 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I have been given a scripting project, but have not learned any scripting. I need to get some ideas on how to start. Attached is part of the project:
I have no idea how to parse the arguments. What I had in mind was to get the arguments ($1, $2, ... ) and have if statements for different... (1 Reply)
Discussion started by: facepalm
1 Replies
2. UNIX and Linux Applications
Dear all,
i am in last year of electronics department in engineering faculty
i need suggestions for a graduation project based on unix or free bsd or linux and electronics "embedded linux "
i think about embedded unix for example or device drivers
please i need helps (1 Reply)
Discussion started by: MOHA-1
1 Replies
3. Solaris
Hello,
I wrote a script which monitor the keyswitch state repeatedly each 10 minutes.
I'm extracting the keyswitch status by using prtdiag.
The script works fine for Netra v440 , but I found that prtdiag under Netra 1290 don't give keyswitch status.
unlike Netra 440 server , I found that... (2 Replies)
Discussion started by: Alalush
2 Replies
4. Solaris
so i've grabbed this sun netra t1 for some small dev work. now obviously i need to install sol10. no problem done it a million times except for the fact that i've never actually done it w/o a term server. so i grab a usb to serial and a serial to rj45 (the one you get in every cisco order.. roll... (24 Replies)
Discussion started by: pupp
24 Replies
5. What is on Your Mind?
guys - not sure where to post this one but i figured this was the likely spot.
i need a sun dvd slimline for netra t1. hcl matrix has this for production/manufac. number: X7288A / 540-5014.
anyone have a good spot to get this stuff? does anyone have an extra laying around to sell? i hate going... (2 Replies)
Discussion started by: pupp
2 Replies
6. Shell Programming and Scripting
i need to compare to dates/times given in the format MMDDhhmmYY. That is month, day, hour, minute, year. It is a 24 hour clock. I need to compare two dates to check that they are, say, less than 900 seconds apart. I have got to a point where it checks the time, turns the values into seconds and... (5 Replies)
Discussion started by: fwabbly
5 Replies
7. Cybersecurity
Hi,
I installed sybase server on a LINUX server. I assigen port 2025 whilst installation for sybase , later i uninstalled sybase and when i try to reinstall sybase and use port 2025 it throw up error saying that it is already in use, use other port number. How can I re-use the same port number... (2 Replies)
Discussion started by: suda
2 Replies
8. Shell Programming and Scripting
I have several staging directories on my UNIX server.
/usr2/data1
/usr2/data2
/usr2/data3
/usr2/data4
/usr2/data5
/usr2/data6
In these directories a file is transferred from different PC's connected to the network via TCP/IP. The File name is constant for all directories.
Transfers... (1 Reply)
Discussion started by: Docboyeee
1 Replies
SYSMON_PSWITCH(9) BSD Kernel Developer's Manual SYSMON_PSWITCH(9)
NAME
sysmon_pswitch -- framework for power switches
SYNOPSIS
#include <dev/sysmon/sysmonvar.h>
int
sysmon_pswitch_register(struct sysmon_pswitch *smpsw);
void
sysmon_pswitch_unregister(struct sysmon_pswitch *smpsw);
void
sysmon_pswitch_event(struct sysmon_pswitch *smpsw, int event);
DESCRIPTION
The machine-independent sysmon_pswitch provides a framework for power management. The interface has been largely superceded by the pmf(9)
framework, but sysmon_pswitch is still used to manage power switches as well as related mechanical adapters and buttons. These are encapsu-
lated in the following structure:
struct sysmon_pswitch {
const char *smpsw_name; /* power switch name */
int smpsw_type; /* power switch type */
LIST_ENTRY(sysmon_pswitch) smpsw_list;
};
Unsurprisingly, smpsw_name specifies the name of the power switch and smpsw_type defines the type of it. The following types are defined:
PSWITCH_TYPE_POWER
PSWITCH_TYPE_SLEEP
PSWITCH_TYPE_LID
PSWITCH_TYPE_RESET
PSWITCH_TYPE_ACADAPTER
PSWITCH_TYPE_HOTKEY
If the type is PSWITCH_TYPE_HOTKEY, there are few predefined names that can be used for smpsw_name:
PSWITCH_HK_DISPLAY_CYCLE display-cycle
PSWITCH_HK_LOCK_SCREEN lock-screen
PSWITCH_HK_BATTERY_INFO battery-info
PSWITCH_HK_EJECT_BUTTON eject-button
PSWITCH_HK_ZOOM_BUTTON zoom-button
PSWITCH_HK_VENDOR_BUTTON vendor-button
Once a power switch event has been proceeded, sysmon_pswitch will inform the user space powerd(8), which will possibly execute a script
matching the type of the power switch.
FUNCTIONS
After the sysmon_pswitch structure has been initialized, a new power switch device can be registered by using sysmon_pswitch_register(). The
device can be detached from the framework by sysmon_pswitch_unregister().
The sysmon_pswitch_event() is used to signal a new power switch event. There are two possibilities for the value of event:
PSWITCH_EVENT_PRESSED A button has been pressed, the lid has been closed, the AC adapter is off, etc.
PSWITCH_EVENT_RELEASED A button has been released, the lid is open, the AC adapter is on, etc.
The corresponding events in powerd(8) are pressed and released.
SEE ALSO
powerd(8), pmf(9), sysmon_envsys(9), sysmon_taskq(9)
AUTHORS
Jason R. Thorpe <thorpej@NetBSD.org>
BSD
January 26, 2010 BSD