Checking level?
Hi Experts,
I would like to clear a doubt.....in SAP what do we mean by saying.....AT WHAT LEVEL DOES THAT HAPPEN??
lemme explain more....for eg. if i say...at what level settings for availabilty check are done/happen(plant level, item category level etc), or at what level credit management setttinds are done??????what do we exactly mean by all this?
As sometimes it is been asked......at what levels does the settings for (say availabilty check) are done?
What exactly do we mean by LEVEL....does that mean the screens in which we do the settings for...or is it sthg related to the backround processing?
Hope...i m able to put my question through properly..
Awaiting replies....useful answers will be rewarded.
Thanks....
Him
Well the question is still not straight forward, but let me explain you as per my understanding.
"At what level" means the highest possible organizational level at which you activate some settings so that it is applicable for all the elements under that organizational element.
For example, if you maintain some master data related to availability check in the material master at some plant XY, the whenever you are going to create a sales order / stock transfer order, for that material from plant XY, it will guide the syatem as per the settings maintained.
And if the settings are maintained indipendant of material , but at plant level, it will be applicable for all materials delivered from that plant.
So Plant is at the highest level in this case.
There are some settings which are at the Level of Compay codes, so are applicale for all elements under that company code.
Hope this will clarify your requirement.
Reard points if this helps.
Regards,
Harsh
Similar Messages
-
so if I enable Sound Check and then increase the volume on an individual song will that song revert to playing at the sound check level??
If that's the best you can do why don't you get on another forum?
-
Enabling (checking) Levels adjustments alone already changes image
Have a look at this. First image, straight out of the box, new version from master with no adjustments whatsoever done by me:
http://homepage.hispeed.ch/kukushka/levels-unchecked.png
Second image, I only checked the Levels Adjustment section, did not touch any slider:
http://homepage.hispeed.ch/kukushka/levels-checked.png
At a first glance, simply checking the Levels adjustment section, seems to do something similar as applying a little bit of the 'Shadows' adjustment. It mainly seems to recover some detail in dark areas.
Further analysis of the png screenshots in Photoshop reveals that no (new) detail was actually recovered. Differences that were between [0 1 0] and [1 4 1] were 'enlarged' to [0 5 0] vs. [5 15 5] making them actually visible.
As you can also see in the screenshots the histogram is also moved a little bit away from the left edge (in line with the visual differences).
A couple of questions:
1) What the heck is going on? Is this a feature or a bug?
2) My (professional) printing lab, already charging $2 per print, seems to print everything below [15 15 15] as what looks to me pure black. I am asking myself whether using the Levels tool (which I do on most images) brightens up the dark areas (and/or increasing the contrast there) in such a way that the dark areas look fine onscreen but too dark when printed on photographic paper.I have tested an Aperture installation on a Mac Pro in a local Apple retailer. The problem is not visible there, ie, no discernable change to the image (no brightening) as the Levels checkbox is checked. The histogram changes all so slightly, so little that I attribute it just as an effect of numerical rounding.
The staff suggested that the main difference between my system (MacBook Pro 2.33, 256 MB VRAM) and the Mac Pro is the graphic card. This could mean a bug in the graphic card or a bug in Aperture that only manifests itself with certain graphic cards.
I should add that none of the (~20) computer in the store had a calibrated display. My display is calibrated with the Huey, the differences in dark areas of an images are almost always much less discernable on a non-calibrated display. -
No live audio unless I press record and play but no way to check levels
Using Premiere Pro 6 and plugging my audio mixer into the input of my line input of the sound card, I can using Windows 7 select to hear the input all the time, say for some background music but I want to feed the mic through the mixer and lay an audio track.
So I add a new audio track, hit R and hit the recording button and then no input noise and no meters moving so hit play and hey presto, I hear audio, with a slight delay but blast - its already started recording before I setup levels etc.
Is there a work around to allow me hearing the live input when track laying this audio before hitting the play button ?
Many Thanks
Alan
Running an AsusP8z68
i7 3.6
16 meg ram
660 Gforce video
M500 SSDOn CC2014.1 you can 'meter input(s) only' in keyboard shortcuts for the track mixer.
Not sure about monitoring though, or if this existed in CS6 (before my time!) -
MIGO_GR Authorization check for PO Document type
Hi Friends,
We would like restrict users processing GR's against certain PO document types. In brief, <b>X</b> group of users are allowed to process GR's against PO document type <b>'NB'</b> only. This validation should take place soon after they enter the PO number or at the check level in MIGO_GR.
Unfortunately, MIGO does not provide relevant standard authorization object... or EXITS to achieve this.
Appreciate, if you share your expertice in this regard . Points will be awarded...
Regards
KumarBy defining custom authorisation object.
-
Need to Create a Check for Plant in WBS & Plant in Network
Dear Guru's,
While creating Project (CJ01) my users are creating in a Plant, and while creating network for the same project/WBS, they are using different Plant Code.
Since my Profit center is related to the plant in CJ01,
and because of wrong Plant in network, all my PR/ PO is going in a different Profit center, which is creating a huge problem while auditing.
I need to Create a Check for Plant in WBS & Plant in Network...!!
Kindly suggest me the ways to do it and how to do it...Hi Deepa,
The Check you are trying to create between Plant defined at Project def and network level that should be same can be achieved through validation at the network level by using a user exit at network level.
While creating the network you can change the plant value not equal to the value at proj def/network profile may be one of the reason is since the network type is defined for more than one plant (OPUV).
While creating validations at network level we do not have the option of setting the prerequisite/check using WBS or Proj def fields (i.e. PROJ-, PRPS- fields) so we need to create a user exit at the network level.
I am not sure but logically u can have a user exit for both prerequisite and check steps of the validation.
You need to create the user exit in program ZGGBR000.
Please take help from your Abaper for the same.
OPSI-Network header-Validation- Step - Prerequisite u2013 Check u2013 Message.
Prerequisite
If Proj Profile = u2018XXXu2019 and Network Profile = u2018XXu2019 (or as per your logic if need be use a exit)
CHECK.
PROJ-WERKS = CAUFVD-WERKS (This logic needs to be defined in user exit and set the same user exit at the check.)
Once you define the user exit in ZGGBR000, it will be available in the tab u2018exitsu2019 at the Prerequisite and Check levels.
The name of the form pool (e.g., ZGGBR000) that contains your user exit must be stored in table T80D.
It is important that you make declare the code generation program for your user exit; how many and what type of parameters you are using for the user exit. You do this by entering your newly defined user exits in the form routine GET_EXIT_TITLES. Found in program ZGGBR000.
Check with your Abaper to check on all the aboveu2026
Message:
Plant at Network level should be same as at Project def level.
Hope it helps you,All the best..
Regards
Vinayak. -
Update check status in FPCHR (issued from FI-CA) using EBS
Hi All -
We are planning to use FI-CA for issuing checks to our customers. We are also planning to have EBS.
Based on my searching here is what I have found about how to make FI-CA checks and EBS work.
1. Enhance Event 0061 in FICA so the recon key for check run posts entries (documents) at an individual check level into FICO with all the details like the check number,
2. Enhance event FEB00001 so the R/3 FICO document can be cleared based on the EBS entries.
Now my two questions are
a). If the above two steps are done, will the status of the check in the FPCHR automatically get updated from open to cleared? Just like how FPB12 program in ISU does? Will the encashment date etc get updated?
b). Are the above two steps still relevant since SAP seems to have made significant changes to EBS since 2008.
As always Thanks in Advance for spending your valuable time to answer.
Regards,check this link it might be helpful to you
http://help.sap.com/erp2005_ehp_05/helpdata/EN/0f/0a5241fce5830ae10000000a155106/frameset.htm
thanks,
VR -
Reason 4 levels quiet in logic???
I am using Reason 4 and logic together. When using a redrum, subtractor, etc... from Reason I can never get any volume out of them when rewired to Logic.
For example: I tried a couple kick samples playing a pattern in redrum and in the logic mixer it they are only peaking at -15 to -20 dBs and that is with the sample level turned up to 127 on the redrum, any have this problem or know a fix??
When I play a logic instrument or load up a loop they show up on the mixer peaking anywhere from -5dbs to 0dbs depending on the instrument/loop etc... So i don't know why reason does not do the same...I rewire reason to logic by creating a aux strip in the mixing board and set the input on the strip to reason.
Any help is very much apprecaited
thanksAre you also using the mixer in Reason? Check levels there, too. And then learn how to do it without the Reason mixer. Props have an easy to follow walkthrough on their site http://www.propellerheads.se/substance/rewirehelp/index.cfm?fuseaction=getarticle&article=logic80 it shows first with the mixer and then without. And like Erik said, make sure the levels on the Redrum are all ginger peachy, too. Use prefader metering to confirm levels are good.
Reason sounds better rewired into Logic than it does by itself, without any enhancements or EQ. -
Authorization check by Cost centers
Hello all,
I developed a report in Report Painter and the requirement is that the users be able to run it only for their own CCtrs - challenge is that we are trying to not use variants, custom transactions and also modifying / checking authorization at at SU01 level.
Is there any other way to do this and if yes can you pls provide some details.
Thanks,
Richahi richa,
Authorizations with Variables
Definition
Instead of using a single value or interval, you can also use variables in authorizations. The Customer Exit is called up for these variables while the authorization check is running. The call is carried out with I_STEP = 0. The intervals of characteristic values or hierarchies for which the user is authorized can be returned here. By doing this, the maintenance load for authorizations and profiles can be reduced significantly.
Every cost center manager should only be allowed to evaluate data for his/her cost center. Within the SAP authorization standard, a role or a profile with the authorization for the InfoObject 0COSTCENTER equal to XXXX (XXXX stands for the particular cost center) would have to be made for every cost center manager X. This then has to be entered in the user master record for the cost center manager.
Using variables reduces the authorization maintenance workload with the InfoObject 0COSTCENTER equal to $VARCOST, as well as with the role or the profile, which is maintained for all cost center managers. The value of the variable VARCOST is then set for runtime during the authorization check by the CUSTOMER-EXIT RSR00001.
Maintaining the authorizations restricts the entries for the values to the length of the existing InfoObject. It is possible, however, to use both limits of the interval. In the example 0COSTCENTER with 4 spaces, the variable VARCOST is, therefore, entered as $VAR COST.
There is a buffer for these variables. If this buffer is switched on, the customer exit is only called up once for a variable with the authorization check. In doing so, you avoid calling up the customer exit for variables over and over, as well as decreasing performance. If you want to call up the customer exit each time, you have to deactivate this buffer in the Setting Up Reporting Authorizations. To do this, go to the main menu and choose Extras ® Compatibility ® Buffer for Variables (Customer-Exit) ® Deactivate..
You can also call up the customer exit for authorizations for hierarchies. There are two ways to do this:
1. Enter the variable in the authorization for characteristic 0TCTAUTHH. The customer exit is then called up while the authorization check is running. In the LOW fields of the return table E_T_RANGE, the system anticipates the technical name for the hierarchy authorization that you specified in the authorization maintenance (transaction RSSM).
As a result, all parameters are available for such an authorization. Nevertheless, you must also create a new definition for each node.
2. Where many authorizations differ from an authorization for a hierarchy only in respect to the nodes and not to the other authorizations, we suggest the following solution: Different users can be authorized for a specific hierarchy area (subtree). The highest node is different for each user.
Do this by creating an authorization for a hierarchy in the transaction RSSM and enter this in the authorization or role. Instead of specifying a particular node, you specify the variable in the authorization maintenance (transaction RSSM). The customer exit is then called up for the node while the authorization check is running. The return table E_T_RANGE must be filled according to the customer exit documentation (nodes in the LOW field, InfoObject of the node in the HIGH field
Setting Up Reporting Authorizations
Use
Before you are able to set up reporting authorizations, you have to create authorization objects.
As soon as an authorization object is saved, it can be checked when a query is run. The user may not have the appropriate authorizations if he or she has not yet been assigned this authorization object.
Only when the user has been assigned the appropriate authorizations can he/she define and execute a query or navigate in an existing query.
If in the query a characteristic value or a node is excluded, a complete authorization check * is required.
Procedure
Creating an authorization object
1. In the SAP Easy Access initial screen of the SAP Business Information Warehouse, choose the path SAP Menu ® Business Explorer ® Authorizations ® Reporting Authorization Objects.
2. Choose Authorization Object ® Create. Give the authorization object a technical name and a regular name. Save your entries.
3. On the right-hand side of the screen, an overview of all the InfoObjects that are authorization-relevant is displayed.
Only those characteristics that have been flagged as authorization-relevant previously in the InfoObject maintenance screen can be assigned as fields for an authorization object. See also: Creating InfoObjects: Characteristics
4. Assign the InfoObject fields to the authorization object:
¡ Select the characteristics for which you want an authorization check of the selection conditions to be carried out.
¡ Select the InfoObject key figure (1KYFNM) if you want to restrict the authorization to a single key figure.
¡ Select the InfoObject (0TCTAUTHH) if you want to check authorizations for a hierarchy.
¡ Include the authorization field activity (ACTVT) in the authorization object if you want to check authorizations for documents.
5. Save your entries.
6. Go back to the initial screen of the authorization maintenance.
7. Choose Check for InfoProviders ® Display to get a list of the InfoProviders that contain the InfoObjects that you selected and are therefore subject to an authorization check (where-used list). In the change mode you can exclude individual InfoProviders from the authorization check for this authorization object by removing the flag.
Authorization object: S_RSRSAREA
Name: Sales area
Fields: DIVISION, CUSTGROUP, 1KYFNM
Creating authorizations
Authorizations are created and maintained in the role maintenance screens.
1. Choose Authorizations ® Roles ® Change.
2. Specify the roles that you want to change and choose Change. This takes you to the role maintenance screen.
3. On the Authorizations tabstrip, choose the Expert mode for generating profiles option.
4. Choose the Enter Authorization Objects Manually option, and specify the objects that you require. Choose Enter. The authorization object is added to the role.
5. Choose Generate.
For more information, see Changing and Assigning Roles.
Result
The user is now able to work with queries
Authorizations to Work with a Query
Use
Authorizations to work with a query are first checked in the dialog box to open a query.
Furthermore, when a query is opened, the authorizations for the individual objects are checked.
See also: Authorization Check When Executing a Query..
Structure
Check in the Open Dialog Box:
When you open a query, you will see four buttons in the dialog box. The History, Favorites and Roles buttons only display your own queries and those queries intended for you per role definition.
The InfoAreas button enables you to look at all queries for which the user has display authorization. If this display authorization is not restricted to queries, the user will see all available queries in the system here. It is possible to hide the InfoAreas button if you do not want the user to see all queries in the system. The authorization object S_RS_FOLD with the field SUP_FOLDER can be used here. In order to hide the InfoArea button, set this field to X when authorizing, otherwise leave the field blank or set it to * (asterisk all authorizations).. The button will be displayed if the authorization check fails.
Authorizations by User
It is also possible to make queries from particular users (= OWNER = query creator) available to other users (= USER) for display or processing. The authorization object S_RS_COMP1 with four fields (COMPID, COMPTYPE, OWNER, ACTVT) is used here.
You can grant this authorization to a particular team or use the variable $USER to give all users the authorization for queries that they created themselves. $USER is replaced by the corresponding user name during the authorization check.
See also the Example for Reporting Authorizations.
Authorizations for the BEx Broadcaster
Using the authorization object S_RS_BCS, you can determine which user is allowed to register broadcasting settings for execution and in which way.
Note:
· The only authorization necessary for the online execution of broadcasting settings is the authorization for the execution of the underlying reporting objects (for example, the Web template).
· Every user that has authorization to create background jobs also has authorization for direct scheduling in the background.
· If you need to work under the name of another user to execute broadcast settings (for example with user-specific precalculations), the authorization object S_BTCH_NAM for background scheduling is also required for the other user. For more information, see Authorizations for Background Processing and Definition of Users for Background Processing
Authorizations for Selection Criteria
Definition
The selection criteria of a query determine which data can be displayed after you have entered it in a workbook.
An authorization check for certain InfoObjects only takes place if an authorization object with this InfoObject was already created in the authorization object class Business Information Warehouse.
As soon as an authorization object is created, only authorized users can select query data.
Use
To decide whether a user should be authorized to work with a query, you should check whether authorization has been given to him/her for all selection criteria.
Essential to the authorization of selection criteria is the authorization object S_RS_ICUBE.
Definitions of authorizations for working with certain InfoCubes must be transported separately.
See: Transporting Additional Information
In general, it is not sufficient to give authorizations for individual InfoObjects (characteristics and key figures), or to check them separately from one another. It more usual that specific authorizations should be given for combinations of characteristics and key figures.
It is therefore feasible that a "Sales Manager" is allowed to view the respective total sales figures for all sales areas, but is only authorized to break down "his/her" area (0001) according to the individual sales personnel. In this case, the following authorizations, which are grouped together, would be created and assigned.
Sales area = *
Sales personnel = :
Key figure = Sales figures
(: represents the authorization to view the values aggregated with the characteristic.
Sales area = 0001
Sales personnel = *
Key figure = Sales figures
The user frequently uses these "multidimensional" authorities in companies that are regional as well as product-oriented (matrix organization). In this way, you could arrange for the person responsible for the combination of a certain division and a certain sales area to have the exact authorization for the output of the relevant values, without him/her necessarily also having access to the data for the whole division or the whole sales area.
Authorizations for the Query Definition
Authorizations can be granted for the following objects for the query definition in the Business Explorer:
The entire query
Structures
Calculated key figures
Restricted key figures
Variables
The activities for the query definition are specified in the authorization object S_RS_COMP (Business Explorer - components). The authorization object has the following fields: InfoArea, InfoCube, component type, component name and activity.
The following values are possible for the component type:
REP: Entire query
STR: Structure
CKF: Calculated key figure
RKF: Restricted key figure
VAR: Variables
By specifying an InfoArea or an InfoCube, you can further restrict the component types. By specifying a component name, you can specify the authorization for individual components in more detail. Components that begin with 0 are delivered by SAP and cannot be changed. Components that are within the customer name range must begin with a letter of the alphabet.
Valid activities are:
01 (create)
02 (change)
03 (display)
06 (delete)
At the moment, activities 16 (Execute) and 22 (Save for Reuse) are not checked for the query definition.
User A is allowed to create, change or delete queries beginning with A1 and A6 within InfoArea 0001 in InfoCube 0002. In addition, the user is allowed to change the calculated key figures and structures (templates) already defined in this InfoProvider.
Related authorizations for user A:
InfoArea: 0001
InfoProvider: 0002
Component type: REP
Component Name: A1, A6
Activity: 01, 02, 06
InfoArea: *
InfoProvider: 0002*
Component type: STR, CKF
Component name: *
Activity: 02
Authorizations for Display Attributes
Definition
Authorization-relevant display attributes are hidden in the query if the user does not have sufficient authorization to view them.
Use
For characteristics:
The user needs to have complete authorization (*) to see the display attribute in the query.
For the characteristic 0EMPLOYEE, the 0EMPLSTATUS attribute is authorization-relevant. Only users with authorization "*" for 0EMPLSTATUS can display the attribute in the query.
For key figures:
Key figures cannot be marked as authorization-relevant. To use this function nonetheless for key figure attributes, the system checks against meta object 1KYFNM. For this, the user requires authorization for the field 1KYFNM in the authorization object.
The key figure attribute 0ANSALARY is contained in the 0EMPLOYEE characteristic.
If the user has the 1KYFNM field in his or her authorization object, and authorization "*", he or she can display all key figure attributes.
If the user has the 1KYFNM field in the authorization object and the 0ANSALARY key figure as a value of the authorization, he or she can only see this key figure attribute. If the user is not supposed to see this attribute, do not give the authorization "*" but only assign the key figures for authorization that are to be displayed.
Authorizations for Navigation Attributes
Use
During authorization checks for navigation attributes, it is always the characteristic that is being used as a navigation attribute that is checked.
Integration
If referencing characteristics are used as navigation attributes, authorization for the basic characteristic is checked. You should, however, change this logic so that the referencing characteristic is checked for instead. In the maintenance screen for reporting authorizations, choose the following path from the main menu Extras ® Compatibility ® Navigation Attributes ® Switch Off.
This function exists for reasons of compatibility. The authorization logic of referencing characteristics worked differently with the beginning of Release BW 2.0. From BW 2.0, Support Package 20 and in all of the releases that follow, for referencing characteristics as well, the authorization for exactly this characteristic (and not the basic characteristic, as was the case previously) is checked.
Example
In the query, you use characteristic A with the navigation attributes A__B and A__R. Characteristic R references characteristic B. For these navigation attributes, authorization for the basic characteristic B is checked. If you switch off the compatibility for navigation attributes option, B is checked for A__B, and R is check for A__R.
Maintaining Authorizations for Hierarchies
Use
Authorizations for hierarchies determine up to which subarea of a hierarchy a user may drilldown.
Prerequisites
Before you can set authorizations for hierarchies, you must first transfer and activate the InfoObject 0TCTAUTHH from the Business Content. Make sure that the indicator Relevant for Authorization is set. You must also create an authorization object for which you want to set the authorization.
Authorization for a hierarchy on the Profit Center characteristic (0PROFIT_CTR):
Define an authorization object with 0PROFIT_CTR and 0TCTAUTHH.
Example: You define a hierarchy for the basic characteristic B. For characteristic B there is a referencing characteristic R. If you use this hierarchy for characteristic R in the query, authorization for the basic characteristic B is checked. However, you can change this logic so that characteristic R is checked for instead. In the maintenance screen for reporting authorizations, choose the following path from the main menu Extras ® Compatibility ® Ref. Characteristics with Hierarchy ® Switch Off.
You need the characteristic 0TCTAUTHH to specify the hierarchy in the authorization. If you add this characteristic to an authorization object, you can specify authorizations for hierarchies for all InfoObjects in the authorization object.
Procedure
1. In the SAP Easy Access initial screen of the SAP Business Information Warehouse, choose SAP Menu ® Business Explorer ®Reporting Authorization Objects.
2. Choose Authorizations ® Authorization Definition for Hierarchies ® Change.
3. In the Definition, select the InfoObject, hierarchy and node.
If there are several users who are authorized to work with just one part of a hierarchy (subtree) but the top node is different for each, you have the option of specifying a variable instead of a node.
See also: Variable Types
Instead of selecting a node, you can also set the Top of hierarchy indicator. This enables you to ensure that a user is authorized to use a hierarchy from the top node down to a determined level.
You can select the top node here. However, if the hierarchy is being used in a query without a filter on this node, the user will not be able to execute the query.
This is because the top-most visible node does not represent the actual top of the hierarchy. As, for example, there are other Remaining Leaves, there should always be exactly one internal node at the top of the hierarchy. Therefore, there is one internal node above the top-most visible node. If the hierarchy is used in a query without the top-most node being determined, it is compared with this unseen, internal node. So that the user has the correct authorizations, select the internal top of the hierarchy for this option.
4. Select the authorization type:
¡ 0 for the node
¡ 1 for a subtree below the node
¡ 2 for a subtree below the node up to and including a level (absolute)
You must define a level for this type. A typical example of an absolute level is data protection with regard to the degree of detail of the data (works council ruling: no reports at employee level only at more summarized levels).
¡ 3 for the entire hierarchy
¡ 4 for a subtree below the node up to and including a level (relative)
You must specify a level that is defined relative to the node for this type. It makes sense to specify a relative distance if an employee may only expand the hierarchy to a certain depth below his or her initial node, but this node moves to another level when the hierarchy is restructured.
5. For types 2 and 4 you can specify, in Hierarchy Level, the level to which the user can expand the hierarchy.
¡ With authorization type 2 (up to and including a level, absolute) the level refers to the absolute number of the level in the hierarchy where the top-most node of the hierarchy is level 1.
¡ With authorization type 4 (up to and including a level, relative) the level number refers to the number of levels starting from the selected node itself which is level 1.
6. In the Validity Area you specify in exactly which ways a hierarchy authorization has to match a selected display hierarchy for it to be included in the authorization check.
¡ Type 0 (very high) : The name, version and key date of the hierarchy on which the hierarchy authorization is based have to agree with the selected display hierarchy.
¡ Type 1: The name and version of the hierarchy on which the hierarchy authorization is based have to agree with the selected display hierarchy.
¡ Type 2: The name of the hierarchy on which the hierarchy authorization is based has to agree with the display hierarchy.
¡ Type 3 (lowest) : None of the characteristics have to match.
Note that in some circumstances, setting a check level that is too low may lead to more nodes being selected using hierarchy node variables that are filled from authorizations, than actually exist in the display hierarchy for the query. This can cause an error message.
As a general rule, select the highest possible level for the check.
7. If you set the Node variable default value indicator, this definition of an authorization for a hierarchy is used as the default value for node variables.
If more than several authorizations are assigned to a user for different subareas of the same hierarchy, one of these authorizations has to be defined as the default value. Only one node can be selected for a node variable on the variable screen of a query. So that this variable can be filled from the authorizations, the correct variable type has to be selected and an authorization has to be determined as the default value.
8. Specify a technical name for this definition. If you do not enter a value, a unique ID is set.
9. Now create an authorization for the new authorization object. To do this, enter the technical name of the definition as a characteristic value for the characteristic 0TCTAUTHH. Hierarchy authorizations and authorizations for characteristic values are added:
¡ Specify the value (a blank character) as a characteristic value if only hierarchy authorizations are to be in effect. If you specify more values these are authorized additionally.
¡ Specify the value : (a colon) when queries are also allowed without this characteristic.
The value ' (all characteristic values) is not supported for the characteristic 0TCTAUTHH. Nevertheless, if you specify the value a : is automatically generated instead because no other valid value is found.
If you would like the user to be able to see all values and hierarchies for a characteristic, use the value '*' for this characteristic.
If you use a drilldown hierarchy in the query, you restrict the highest node by a fixed node or a node variable.
Definitions of authorizations for hierarchies must be transported separately. See: Transporting Additional Information
Alternative Procedure:
Manually Maintaining Reporting Authorizations
Use
You usually maintain authorizations in the role maintenance. However, in exceptional cases it could be more practical to create authorizations manually. This is the case if you have to assign every user his/her own role.
Prerequisites
Reporting authorization objects have been created.
Procedure
Assign Authorization Objects
1. In the SAP Easy Access initial screen of the SAP Business Information Warehouse, choose SAP Menu ® Business Explorer ® Authorizations ® Reporting Authorization Objects.
2. Choose Authorizations ® Authorizations for Several Users. Enter an interval and choose Change.
3. Select a characteristic from the left side of the screen. You can then display master data as a list or as a hierarchy. The right side of the screen shows you a list of all the selected users with the authorization profiles and roles you assigned.
4. You can now use Drag&Drop to assign additional authorization objects to the user.
5. Choose Generate authorizations. The system creates the authorizations and assigns them to the users.
Assigning Authorizations for Hierarchies
You can also make authorizations for hierarchies in the same transaction.
1. Select a characteristic.
2. You can use the context menu on the authorization object to determine up to which hierarchy level the authorization should apply.
You can currently select exactly 1 level for each hierarchy and user.
3. Choose Generate authorizations. The system creates the authorizations and assigns them to the user.
Result
The system has created individual authorization profiles.
thanks
karthik
reward me ipoints if the above is usefull to you -
Leveling delays project end date compared to manual rescheduling
Hi,
Best wishes to you all!
New year, new problems. When I build my plan in MS Project and reschedule overallocations (to available date) on the go, instead of leveling everything at once after assigning all resources first, I get a shorter total duration. There is one factor
which I can imagine has an impact on the result:
- The tasks are not dependent on eachother. Most tasks have a predecessor but most task in a summary share the same predecessor. And even tasks from different summaries share the same predecessor.
Other than that I can't see why MS Project isn't managing my resources as efficient as I do myself with the option 'reschedule to available date'. I.a. I think that MS Project just may not be the right application to do both: project planning and resource
planning. Basically the planning is really about managing resources so to have resources with an allocation of close to 100% spread over multiple projects. I'm working with MSP for 2.5 months now and doubt that this is possible in an easy way. If I'm
totally off here I'd really like to hear.
I used this settings to level: Manual, Clear leveling values before leveling checked, Level entire project checked, Leveling order: ID Only, and only Leveling can adjust individual assignment on a task and Level manually scheduled tasks checked.
When leveling by ID Only I expect MS Project to level the tasks according to their ID number. So in most cases task 1 starts sooner than task 5. I had a few cases (f.e. 2 tasks in same summary, same resource, same predecessor, no successor) where the
first task got scheduled behind the second task.The beauty of MSP is that it is a tool which allows you to model scope, time and cost all together. You can't do any better than that if you separate the tasks from the resource management. I see many situations where there is an attempt to separate the
"schedule" from the resources and/or from the costs (they do it in a spreadsheet). This causes one big problem every time and that is that is it is impossible to keep them synchronised.
In project management, which is defined from the start as being about the tasks, the planning objective is not to make sure that everyone is working or necessarily "really about managing resources so to have resources with an allocation of close
to 100% spread over multiple projects", but if that happens it is a bonus. It is getting the tasks done that is most important.
I never use the "reschedule to available date" because we see a few posts from people who say it crashes MSP etc. Instead, I always go to leveling options and check. Try first of all leveling with none of the fine tuning check boxes turned on.
And if you do use them, try not to use them in combination. Leveling by priority is useful because it gives you a way to nudge the leveling to your preferences.
Be sure that there are no resources assigned to the summaries.
You mention that you have manually scheduled tasks as well as some tasks which have no predecessor and/or no successor. Do you also have tasks with date constraints, and predecessor/successor links to/from summaries? All of these will make leveling more
problematic, if not cause leveling problems directly. It is possible to make a closed network (every task has at least one FS0 predecessor and at least one FS0 successor, except the first and last of course) with no manually scheduled tasks, no predecessors/successor
on summaries, no date constraints. The residential construction template is a good example, which includes some resource over-allocation for leveling practice. -
Pre Flight Record Check List Alesis Firewire, Creative Sound Card, Adobe Audition
I was having many crashes on my computer, Windows Vista, so I made a check list to put a stop to all the crashes. This is what has worked for me I hope it works to you. Just so you all know since the recording I do is for the church radio shows that we produce. We start and end with a prayer. God Bless
Pre Flight Record Check List: To RECORD
Disconnect all Periphials
Reboot: Computer
Printer: OFF (not connected to recording copmptuer)
Speakers: All OFF
Closet Light: OFF
Cell Phones: OFF
Lockdown Internet
Disable Firewall
Computer Volume Settings: Alesis Microphone
2 Ch, 16 Bit, 44,100 Hz Cd Quality
* Do not allow applications to take control
Level- 100
Alesis Control Panel
Sample Rate: 44.1 Khz
Buffer 256
Rate: Any
System Sound: enable
System Latency: High
Open Adobe Software: Multitrack View
Adobe Audio Hardware Setup
Edit View: Alesis 44,100 Hz, Buffer Size: 256
Multimix View: Creative
Surround Encoder: Creative
Adobe Multi Track:
Monitoring: External
Adobe Edit Mode: Record in this mode
Click New: for Settings
Sample Rate:44100
* Stereo
* 16 Bit
Alesis Multimix 12
Main Mix
x- Pressed
x-Not Pressed
Alt 3/4
x-Pressed
x-Not Pressed
x-Not Pressed
x-Not Pressed
Sound Check:
Level
Pot: 1
Pot: 3
Main Mix:
ALT: 3/4Alesis stuff is generally pretty good and the Alesis is correct in that it is generally accepted that the TI chips are better and it is good advice.
PCI-e firewire800 card at ARC...
http://www.arc.com.au/?IOFIREPCIE1394B
I paid a $104 AUS it is now $77.90 (go figure)
Unfortunately there is no image on the web site. Without pulling my PC out I'm pretty sure it has 2 outputs and 2 inputs but don't quote me on that.
You should be able to pick something like this up anywhere in the world pretty cheap.
If it was me I would say that it would be a small investment and worth it to see if you can get the Alesis stuff stabalised. -
Rman level 0 backup, how to confirm its full backup or not?
I am performing the level 0 full rman backup on daily basis and i am aware this backup make the base to incremental backup i.e level 1.
When i looked into object_type from v$backup_status, its show label of DB_INCR for level 0 full backup or even same status from EM. My boss suspect we are not taking full backup. Is there any way to prove or confirm, whether backup copies are full backup or not? Pls advise.Hi,
I use the following sql to check levels and speed.
select backup_type,
incremental_level,
round(sum(output_bytes)/1024/1024,2) "MB",
status,
min(start_time),
max(completion_time),
round((sum(output_bytes)/1024/1024)/((max(completion_time)-min(start_time))*86400), 1) "MB/s"
from v$backup_set_details
group by backup_type, incremental_level, status, session_key, session_recid, session_stamp
order by 5
Rgds,
Tycho -
Powershell - Daily Health Check
Hi all,
I have a number of different w8k and w12k servers in different sites and I wanted create a daily health check to check services are up. For instance I can write a ps script to check run at 6am daily and check various services on a windows server and then
generate a html report and mail it to a distribution list. However on some of my servers I only have one service that needs to be checked I wanted a was to check the services and collate all the reports into one place and output just one html report?
So for example could I output the results to a text file, run an ftp job to send the result to a central location and then run a ps to scrap all the results and output to html, or could the text files be scrapped from an email, this method makes better sense
for me as some of these servers will have ACLs between then and getting send via smtp will be easier then ftp.
Would like to know if anyone has any ideas or experience with doing something like this?Are the servers on the same domain? If so use "Enter-PSSession" or if your just checking if a service is running use the "-Computer" switch to execute it on the remote server.
You could also use WMI "Get-WMIObject"
Using the above methods will let you run it from a central location.
My suggestion for performing your health checks is to define in a csv file: Server Name, IP, Heath Check Level
So have an initial Ping for the host name, if that fails then use the IP as DNS might have an issue (record results into file)
Heath Ckeck level determines if your just checking full server health or just checking for a specif service is running (ie Full, Service, ect... you define it for your requirements)
I would use WMI as there could be different versions of powershell installed and take the compatibility issues away when writing the script.
Below is a good starting script for you to use where it queries via WMI and generates a html report that is emailed out.
https://gallery.technet.microsoft.com/scriptcenter/Powershell-Script-to-Get-78687c5e
Cheers,
Martin
Blog:
http://sustaslog.wordpress.com
LinkedIn:
Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. -
Content Tab: None of the fact tables are compatible with the query request
Hi All,
**One thing I am not clear yet of all my years with OBIEE is working with the content tab in BMM.**
I have made a rpd the joins in physical layer as shown below:
https://picasaweb.google.com/114804305606242416264/OBIEEError#5663056545119428530
And the BMM layer as:
https://picasaweb.google.com/114804305606242416264/OBIEEError#5663056519553812930
Error I am getting when i run a request from the 3 columns from the selected 3 tables is:
Dim - Comment Code Details
Fact - Complaint
Dim - Service Details
Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 14020] None of the fact tables are compatible with the query request Sr Num:[DAggr(Fact - Complaint.Sr Num by [ Dim - Service Details.Sr Cat Type Cd, Dim - Comment Code Details.Cmtcode name] )]. (HY000).
I get no error for consistency.. I read everywhere and I know i need to set the appropriate aggregation levels in the various dims and facts LTS properties to help OBIEE understanding our model, but how to do that.. how do i decide... how should I approach, what should be the aggregation level, what details.
When i click More button i see different options: Copy, Copy From, Get Levels, Check Level, what do these mean.
Aggregation Content, group by - Logical Level or Column which one should i choose and how should I decide.
Can anyone explain the Content Tab in details and from scratch with some example and why we get these errors.... I know many people who are well versed with many other things related to RPD but this. A little efforts of explaining from you guys will really be appreciated.
Thanks in advance,
DevHi Deepak,
Option 1:
My tables in physical layer are joined as below:
D1--> F1 <--D2--> F2 <--D3
Same way i model it in BMM
D1--> F1 <-- D2--> F2 <--D3
Here D1 is non Conformed Dimension for F2 and D3 is non Conformed dim for F1. Later create Dimensional hierarchies, I tried setting up the content levels
I go Sources>content tab of Fact F1 I set
Dimensions----------- Logical level
D1---------------------- D1 Detail
D2---------------------- D2 Detail
D3---------------------- D3 Total
then, I go Sources>content tab of Fact F2 I set
Dimensions----------- Logical level
D1---------------------- D1 Total
D2---------------------- D2 Detail
D3---------------------- D3 Detail
Then, I also go in all the dimensions and set their content levels to Details, but it still gives me errors not sure where I am going wrong in setting the content levels.
I need to know whether the way I have modeled it in BMM is right,
Option 2:
I can combine the two facts in a single Logical Fact or the above design should also work.
(F1&F2)<--D1, D2 , D3 joined separately using complex logical joins.
what will be the content tab details?
Thanks,
Dev -
Laptop mode tools problem with kernel 3.0
today I just updated the system and my laptop runs dramatically hotter after that. I read the archwiki, it does talk about the laptop mode tools problem with kernel 3.0 but when I opened the file /usr/sbin/laptop_mode, the lines which the wiki mentions are not there. Does anyone here have the same problem and can you offer the solution?
Here is my /usr/sbin/laptop_mode
#! /bin/sh
# Script to start or stop laptop_mode, and to control various settings of the
# kernel, hardware etc. that influence power consumption.
# This script is a part of Laptop Mode Tools. If you are running a supported
# power management daemon, this script will be automatically called on power
# state change.
# Configure laptop mode tools in /etc/laptop-mode/laptop-mode.conf, and in
# the broken-out config files in /etc/laptop-mode/conf.d.
# Please consult the manual pages laptop-mode.conf(8) and laptop_mode(8) for
# additional information.
# Maintainer: Ritesh Raj Sarraf ([email protected])
# Original Author: Bart Samwel ([email protected])
# Project home page: http://samwel.tk/laptop_mode
# Contributors to this script: Bart Samwel
# Kiko Piris
# Micha Feigin
# Andrew Morton
# Herve Eychenne
# Dax Kelson
# Jan Polacek
# ... and many others that I've stopped
# keeping track of.
# Based on a script for Linux 2.4 written by Jens Axboe.
set -a
# The laptop mode tools version number. Extracted by the installer makefile
# as well, so don't change the format!
LMTVERSION=1.59
# This script is loaded from multiple scripts to set the config defaults
# and to read the configuration on top of those. Only when the command is
# recognized does this script do anything else.
VERBOSE_OUTPUT=0
ENABLE_LAPTOP_MODE_ON_BATTERY=1
ENABLE_LAPTOP_MODE_ON_AC=0
ENABLE_LAPTOP_MODE_WHEN_LID_CLOSED=0
PARTITIONS="auto /dev/mapper/*"
LM_BATT_MAX_LOST_WORK_SECONDS=600
LM_AC_MAX_LOST_WORK_SECONDS=360
DEF_MAX_AGE=30
LM_READAHEAD=3072
NOLM_READAHEAD=128
CONTROL_READAHEAD=1
CONTROL_NOATIME=0
USE_RELATIME=1
CONTROL_HD_IDLE_TIMEOUT=1
LM_AC_HD_IDLE_TIMEOUT=4 # 20 seconds
LM_BATT_HD_IDLE_TIMEOUT=4 # 20 seconds
NOLM_HD_IDLE_TIMEOUT=244 # 2 hours
DEF_UPDATE=5
DEF_XFS_AGE_BUFFER=15
DEF_XFS_SYNC_INTERVAL=30
DEF_XFS_BUFD_INTERVAL=1
XFS_HZ=100
CONTROL_MOUNT_OPTIONS=1
BATT_HD_POWERMGMT=1
LM_AC_HD_POWERMGMT=254
NOLM_AC_HD_POWERMGMT=254
CONTROL_HD_POWERMGMT=0
CONTROL_HD_WRITECACHE=0
NOLM_AC_HD_WRITECACHE=1
NOLM_BATT_HD_WRITECACHE=0
LM_HD_WRITECACHE=0
LM_DIRTY_RATIO=60
LM_DIRTY_BACKGROUND_RATIO=1
NOLM_DIRTY_BACKGROUND_RATIO=10
NOLM_DIRTY_RATIO=40
LM_SECONDS_BEFORE_SYNC=2
BATT_CPU_MAXFREQ=medium
BATT_CPU_MINFREQ=slowest
BATT_CPU_GOVERNOR=ondemand
BATT_CPU_IGNORE_NICE_LOAD=1
LM_AC_CPU_MAXFREQ=fastest
LM_AC_CPU_MINFREQ=slowest
LM_AC_CPU_GOVERNOR=ondemand
LM_AC_CPU_IGNORE_NICE_LOAD=1
NOLM_AC_CPU_MAXFREQ=fastest
NOLM_AC_CPU_MINFREQ=slowest
NOLM_AC_CPU_GOVERNOR=ondemand
NOLM_AC_CPU_IGNORE_NICE_LOAD=0
CONTROL_CPU_FREQUENCY=0
HD="/dev/[hs]d[abcdefgh]"
CONTROL_SYSLOG_CONF=0
LM_AC_SYSLOG_CONF=/etc/syslog-on-ac-with-lm.conf
NOLM_AC_SYSLOG_CONF=/etc/syslog-on-ac-without-lm.conf
BATT_SYSLOG_CONF=/etc/syslog-on-battery.conf
SYSLOG_CONF_SIGNAL_PROGRAM=syslogd
SYSLOG_CONF=/etc/syslog.conf
CONTROL_DPMS_STANDBY=0
BATT_DPMS_STANDBY=300
LM_AC_DPMS_STANDBY=1200
NOLM_AC_DPMS_STANDBY=1200
CONTROL_CPU_THROTTLING=0
BATT_CPU_THROTTLING=medium
LM_AC_CPU_THROTTLING=minimum
NOLM_AC_CPU_THROTTLING=minimum
CONTROL_START_STOP=1
CONTROL_TERMINAL=0
TERMINALS="/dev/vc/1 /dev/vcs1"
BATT_TERMINAL_BLANK_MINUTES=1
BATT_TERMINAL_POWERDOWN_MINUTES=2
LM_AC_TERMINAL_BLANK_MINUTES=10
LM_AC_TERMINAL_POWERDOWN_MINUTES=10
NOLM_AC_TERMINAL_BLANK_MINUTES=10
NOLM_AC_TERMINAL_POWERDOWN_MINUTES=50
ENABLE_AUTO_HIBERNATION=0
HIBERNATE_COMMAND=/usr/sbin/hibernate
AUTO_HIBERNATION_ON_CRITICAL_BATTERY_LEVEL=1
DISABLE_LAPTOP_MODE_ON_CRITICAL_BATTERY_LEVEL=1
AUTO_HIBERNATION_BATTERY_CHARGE_MAH=0
AUTO_HIBERNATION_BATTERY_CHARGE_MWH=0
MINIMUM_BATTERY_CHARGE_MAH=0
MINIMUM_BATTERY_CHARGE_MWH=0
ASSUME_SCSI_IS_SATA=1
CONTROL_BRIGHTNESS=0
BATT_BRIGHTNESS_COMMAND=false
LM_AC_BRIGHTNESS_COMMAND=false
NOLM_AC_BRIGHTNESS_COMMAND=false
LOG_TO_SYSLOG=1
DEBUG=0
ENABLE_LAPTOP_MODE_TOOLS=1
# Initialize the PATH Variable
export PATH="${PATH}":/bin:/sbin:/usr/bin:/usr/sbin
# This is a 2 phase locking approach. LMT_REQ_LOCK is the outer lock and LMT_INVOC_LOCK is the inner lock
# We take this approach to ensure the scenario that, "At any point when an event occurs (AC/BATT), the
# kernel can generate multiple events spanning over a couple of events. The first event is honored and
# lmt executes. If the last event triggered at the 9th second, there is a fair chance that a good amount
# of state change would have occured in the OS, to honor that state, we keep an outer lock (LMT_REQ_LOCK)
# handy, so that those changes can also be applied and not forgotten.
# Workflow:
# Event-1 is generated and lmt executes (lmt runtime could span 5-10 seconds)
# At seventh second, 4 events generate. But Event-1 is still running.
# We don't want to discard all the remaining 4 events, but at least honor 1 so that we can act to the changes
# that occured in the last 7 seconds.
# So, Event-2 acquire LMT_REQ_LOCK and waits to acquire LMT_INVOC_LOCK (which is acquire by Event-1)
LMT_REQ_LOCK="/var/lock/lmt-req.lock"
LMT_INVOC_LOCK="/var/lock/lmt-invoc.lock"
FLOCK=`which flock`
checkint ()
# $1 arg should be the string/integer
# that you want to check for as an integer.
echo $1 | grep "[^0-9]" > /dev/null 2>&1
return $?;
# Returns 1 if it is an integer
# Function to handle logging
LOGGER=`which logger`;
log ()
# $1 should be msg type
# $2 should be the real msg
if [ x$LOG_TO_SYSLOG = x1 ]; then
# NOTE: Add the check on $2 being empty, once you are confident
# that there aren't any bugs in logging. And no bugs in executing
# modules and logging
if [ -x $LOGGER -a "$1" != "STATUS" ]; then
#if [ -z $2 ]; then
# continue
#elif [ "$1" = "MSG" ]; then
if [ "$1" = "MSG" ]; then
logger -p daemon.info -t laptop-mode "$2";
elif [ "$1" = "ERR" ]; then
logger -p daemon.err -t laptop-mode "$2";
elif [ "$1" = "VERBOSE" ]; then
if [ x$VERBOSE_OUTPUT = x1 ]; then
logger -p daemon.debug -t laptop-mode "$2";
fi
else
logger -p daemon.notice -t laptop-mode "$2";
fi
fi
fi
if [ "$1" = "VERBOSE" ]; then
$LM_VERBOSE && echo "$2" >/dev/fd/2;
elif [ "$1" = "ERR" ]; then
echo "$2" >/dev/fd/2;
else
# Message of type MSG and STATUS can go to stdout.
echo "$2" >/dev/fd/1;
fi
enableDebug ()
# Check if debug is enabled
if [ x$(($(basename $1 | cut -d . -f1 | tr "[:lower:]" "[:upper:]" | sed 's/-/_/g')_DEBUG)) = x1 ]; then
set -vx
fi
disableDebug ()
# Check if debug is enabled
if [ x$(($(basename $1 | cut -d . -f1 | tr "[:lower:]" "[:upper:]" | sed 's/-/_/g')_DEBUG)) = x1 ]; then
set +vx
fi
# No default on these ones -- we need to detect if they have been set, for
# backward compatibility with MINIMUM_BATTERY_MINUTES etc.
AUTO_HIBERNATION_BATTERY_CHARGE_PERCENT=
MINIMUM_BATTERY_CHARGE_PERCENT=
# Backward compatibility variable that is sometimes
# set externally (Debian init system)
unset VERBOSE
lmt_load_config ()
# Source config. Some config settings have been moved from the main config file
# to modular configuration files, and to support existing laptop-mode.conf
# files from earlier versions, we source the modular configuration files FIRST.
if [ -d /etc/laptop-mode/conf.d ] ; then
for CONF in /etc/laptop-mode/conf.d/*.conf ; do
if [ -r "$CONF" ] ; then
. "$CONF"
#Handle individual module debug settings
if [ "$DEBUG" -eq 1 ]; then
export $(basename $CONF | cut -d . -f1 | tr "[:lower:]" "[:upper:]" | sed 's/-/_/g')_DEBUG=1
log "VERBOSE" "Enabling debug mode for module $CONF"
fi
DEBUG=0
else
log "MSG" "Warning: Configuration file $CONF is not readable, skipping."
fi
done
fi
if [ -r /etc/laptop-mode/laptop-mode.conf ] ; then
. /etc/laptop-mode/laptop-mode.conf
else
log "ERR" "$0: Configuration file /etc/laptop-mode/laptop-mode.conf not present or not readable."
exit 1
fi
if [ x$ENABLE_LAPTOP_MODE_TOOLS = x0 ]; then
log "MSG" "laptop-mode-tools is disabled in config file. Exiting"
exit 0;
fi
# Add a simple bash debug mode switch
if [ "$DEBUG" -eq 1 ]; then
set -vx;
fi
# Support for old config settings
if [ "$AC_HD" != "" ] ; then
AC_HD_WITHOUT_LM="$AC_HD"
AC_HD_WITH_LM="$AC_HD"
fi
if [ "$VERBOSE" != "" ] ; then
VERBOSE_OUTPUT="$VERBOSE"
fi
if [ "$CPU_MAXFREQ" != "" ] ; then
BATT_CPU_MAXFREQ="$CPU_MAXFREQ"
fi
if [ "$MAX_AGE" != "" ] ; then
LM_BATT_MAX_LOST_WORK_SECONDS="$MAX_AGE"
LM_AC_MAX_LOST_WORK_SECONDS="$MAX_AGE"
fi
if [ "$DEF_AGE" != "" ] ; then
DEF_MAX_AGE="$DEF_AGE"
fi
if [ "$LAPTOP_MODE_ALWAYS_ON" != "" ] ; then
ENABLE_LAPTOP_MODE_ALWAYS="$LAPTOP_MODE_ALWAYS_ON"
fi
if [ "$LM_WHEN_LID_CLOSED" != "" ] ; then
ENABLE_LAPTOP_MODE_WHEN_LID_CLOSED="$LM_WHEN_LID_CLOSED"
fi
if [ "$REMOUNT_PARTITIONS" != "" ] ; then
PARTITIONS="$REMOUNT_PARTITIONS"
fi
if [ "$READAHEAD" != "" ] ; then
LM_READAHEAD="$READAHEAD"
fi
if [ "$DO_REMOUNT_NOATIME" != "" ] ; then
CONTROL_NOATIME="$DO_REMOUNT_NOATIME"
fi
if [ "$DO_HD" != "" ] ; then
CONTROL_HD_IDLE_TIMEOUT="$DO_HD"
fi
if [ "$AC_HD_WITH_LM" != "" ] ; then
LM_AC_HD_IDLE_TIMEOUT="$AC_HD_WITH_LM"
fi
if [ "$AC_HD_WITHOUT_LM" != "" ] ; then
NOLM_HD_IDLE_TIMEOUT="$AC_HD_WITHOUT_LM"
fi
if [ "$BATT_HD" != "" ] ; then
LM_BATT_HD_IDLE_TIMEOUT="$BATT_HD"
fi
if [ "$DO_REMOUNTS" != "" ] ; then
CONTROL_MOUNT_OPTIONS="$DO_REMOUNTS"
fi
if [ "$DO_HD_POWERMGMT" != "" ] ; then
CONTROL_HD_POWERMGMT="$DO_HD_POWERMGMT"
fi
if [ "$AC_HDPARM_POWERMGMT_WITH_LM" != "" ] ; then
LM_AC_HD_POWERMGMT="$AC_HDPARM_POWERMGMT_WITH_LM"
fi
if [ "$AC_HDPARM_POWERMGMT_WITHOUT_LM" != "" ] ; then
NOLM_AC_HD_POWERMGMT="$AC_HDPARM_POWERMGMT_WITHOUT_LM"
fi
if [ "$BATT_HDPARM_POWERMGMT" != "" ] ; then
BATT_HD_POWERMGMT="$BATT_HDPARM_POWERMGMT"
fi
if [ "$DO_WRITECACHE" != "" ] ; then
CONTROL_HD_WRITECACHE="$DO_WRITECACHE"
fi
if [ "$AC_WRITECACHE_WITHOUT_LM" != "" ] ; then
NOLM_AC_HD_WRITECACHE="$AC_WRITECACHE_WITHOUT_LM"
fi
if [ "$BATT_WRITECACHE" != "" ] ; then
LM_HD_WRITECACHE="$BATT_WRITECACHE"
fi
if [ "$DIRTY_RATIO" != "" ]; then
LM_DIRTY_RATIO="$DIRTY_RATIO"
fi
if [ "$DIRTY_BACKGROUND_RATIO" != "" ] ; then
LM_DIRTY_BACKGROUND_RATIO="$DIRTY_BACKGROUND_RATIO"
fi
if [ "$DEF_DIRTY_RATIO" != "" ]; then
NOLM_DIRTY_RATIO="$DEF_DIRTY_RATIO"
fi
if [ "$DEF_DIRTY_BACKGROUND_RATIO" != "" ] ; then
NOLM_DIRTY_BACKGROUND_RATIO="$DEF_DIRTY_BACKGROUND_RATIO"
fi
if [ "$DO_CPU" != "" ] ; then
CONTROL_CPU_FREQUENCY="$DO_CPU"
fi
if [ "$CONTROL_CPU_MAXFREQ" != "" ] ; then
CONTROL_CPU_FREQUENCY="$CONTROL_CPU_MAXFREQ"
fi
if [ "$AC_CPU_MAXFREQ_WITH_LM" != "" ] ; then
LM_AC_CPU_MAXFREQ="$AC_CPU_MAXFREQ_WITH_LM"
fi
if [ "$AC_CPU_MAXFREQ_WITHOUT_LM" != "" ] ; then
NOLM_AC_CPU_MAXFREQ="$AC_CPU_MAXFREQ_WITHOUT_LM"
fi
if [ "$DO_SYSLOG" != "" ] ; then
CONTROL_SYSLOG_CONF="$DO_SYSLOG"
fi
if [ "$SYSLOG_SIGNAL_PROGRAM" != "" ] ;then
SYSLOG_CONF_SIGNAL_PROGRAM="$SYSLOG_SIGNAL_PROGRAM"
fi
if [ "$AC_SYSLOG_WITH_LM" != "" ] ; then
LM_AC_SYSLOG_CONF="$AC_SYSLOG_WITH_LM"
fi
if [ "$AC_SYSLOG_WITHOUT_LM" != "" ] ; then
NOLM_AC_SYSLOG_CONF="$AC_SYSLOG_WITHOUT_LM"
fi
if [ "$BATT_SYSLOG" != "" ] ; then
BATT_SYSLOG_CONF="$BATT_SYSLOG"
fi
if [ "$ENABLE_LAPTOP_MODE_ALWAYS" != "" ] ; then
ENABLE_LAPTOP_MODE_ON_AC="$ENABLE_LAPTOP_MODE_ALWAYS"
fi
if [ "$MINIMUM_BATTERY_MINUTES" != "" -a "$MINIMUM_BATTERY_CHARGE_PERCENT" = "" ] ; then
# Use a very conservative estimate (1% = 1 battery minute, 100 minutes in a battery)
# for backward compatibility.
MINIMUM_BATTERY_CHARGE_PERCENT="$MINIMUM_BATTERY_MINUTES"
fi
if [ -z "$MINIMUM_BATTERY_CHARGE_PERCENT" ] ; then
# Apply the default, now that we've determined that this is the minimum.
MINIMUM_BATTERY_CHARGE_PERCENT=3
fi
if [ "$AUTO_HIBERNATION_BATTERY_MINUTES" != "" -a "$AUTO_HIBERNATION_BATTERY_CHARGE_PERCENT" = "" ] ; then
# Use a very conservative estimate (1% = 1 battery minute, 100 minutes in a battery)
# for backward compatibility.
AUTO_HIBERNATION_BATTERY_CHARGE_PERCENT="$AUTO_HIBERNATION_BATTERY_MINUTES"
fi
if [ -z "$AUTO_HIBERNATION_BATTERY_CHARGE_PERCENT" ] ; then
# Apply the default, now that we've determined that this is the minimum.
AUTO_HIBERNATION_BATTERY_CHARGE_PERCENT=2
fi
# Postprocessing
if [ "$VERBOSE_OUTPUT" -ne 0 ] ; then
OUTPUT="/dev/stdout"
LM_VERBOSE="[ 1 = 1 ]"
else
OUTPUT="/dev/null"
LM_VERBOSE="[ 1 = 0 ]"
fi
if [ "$PARTITIONS" = "" ] ; then
PARTITIONS="auto /dev/mapper/*"
fi
# Expand shell wild cards immediately.
PARTITIONS=$( echo $PARTITIONS )
TERMINALS=$( echo $TERMINALS )
# Convert seconds to hdparm -S format
# Everything over 20 minutes is interpreted as 2 hours.
seconds_to_hdparm_S() {
if [ "$1" -eq 0 ] ; then
# disable.
echo 0
elif [ "$1" -gt 0 -a "$1" -lt 5 ] ; then
# 5 seconds minimum
echo 1
elif [ "$1" -le $((240*5)) ] ; then
# Values between 1 and 240 signify increments of 5 seconds
echo $(($1 / 5))
elif [ "$1" -lt $((30*60)) ] ; then
# Values between 20 and 30 minutes are rounded up to 30 minutes.
echo 241
elif [ "$1" -lt $((12*30*60)) ] ; then
# Values between 30 minutes and 6 hours (exclusive) yield values between
# 241 and 251, in 30-minute increments.
echo $(( 240 + ($1 / (30*60)) ))
else
# Larger values effectively indicate no timeout at all.
echo 0
fi
# Convert configured idle timeouts to hdparm -S format.
if [ "$LM_AC_HD_IDLE_TIMEOUT_SECONDS" != "" ] ; then
LM_AC_HD_IDLE_TIMEOUT=$(seconds_to_hdparm_S $LM_AC_HD_IDLE_TIMEOUT_SECONDS)
fi
if [ "$LM_BATT_HD_IDLE_TIMEOUT_SECONDS" != "" ] ; then
LM_BATT_HD_IDLE_TIMEOUT=$(seconds_to_hdparm_S $LM_BATT_HD_IDLE_TIMEOUT_SECONDS)
fi
if [ "$NOLM_HD_IDLE_TIMEOUT_SECONDS" != "" ] ; then
NOLM_HD_IDLE_TIMEOUT=$(seconds_to_hdparm_S $NOLM_HD_IDLE_TIMEOUT_SECONDS)
fi
# The main workhorse.
lmt_main_function ()
if [ "$1" = "status" ] ; then
# Display a status report.
log "STATUS" "Mounts:"
mount | sed "s/^/ /"
log "STATUS" " "
log "STATUS" "Drive power status:"
for disk in $HD; do
if [ -r $disk ]; then
hdparm -C $disk 2>/dev/null | sed "s/^/ /"
else
log "STATUS" " Cannot read $disk, permission denied - $0 needs to be run as root"
fi
done
log "STATUS" " "
log "STATUS" "(NOTE: drive settings affected by Laptop Mode cannot be retrieved.)"
log "STATUS" " "
log "STATUS" "Readahead states:"
cat /etc/mtab | while read DEV MP FST OPTS DUMP PASS ; do
# skip funny stuff
case "$FST" in
rootfs|unionfs|tmpfs|squashfs|sysfs|usbfs|proc|devpts) continue
esac
if [ -b $DEV ] ; then
if [ -r $DEV ] ; then
log "STATUS" " $DEV: $((`blockdev --getra $DEV` / 2)) kB"
else
log "STATUS" " Cannot read $DEV, permission denied - $0 needs to be run as root"
fi
fi
done
log "STATUS" " "
if [ -e /var/run/laptop-mode-tools/enabled ] ; then
log "STATUS" "Laptop Mode Tools is allowed to run: /var/run/laptop-mode-tools/enabled exists."
else
log "STATUS" "Laptop Mode Tools is NOT allowed to run: /var/run/laptop-mode-tools/enabled does not exist."
fi
log "STATUS" " "
STATFILES="/proc/sys/vm/laptop_mode /proc/apm /proc/pmu/info /proc/sys/vm/bdflush /proc/sys/vm/dirty_ratio /proc/sys/fs/xfs/age_buffer /proc/sys/fs/xfs/sync_interval /proc/sys/fs/xfs/lm_age_buffer /proc/sys/fs/xfs/lm_sync_interval /proc/sys/vm/pagebuf/lm_flush_age /proc/sys/fs/xfs/xfsbufd_centisecs /proc/sys/fs/xfs/xfssyncd_centisecs /proc/sys/vm/dirty_background_ratio /proc/sys/vm/dirty_expire_centisecs /proc/sys/fs/xfs/age_buffer/centisecs /proc/sys/vm/dirty_writeback_centisecs /sys/devices/system/cpu/*/cpufreq/cpuinfo_*_freq /sys/devices/system/cpu/*/cpufreq/scaling_governor /proc/acpi/button/lid/*/state /proc/acpi/ac_adapter/*/state /proc/acpi/battery/*/state /sys/class/power_supply/*/online /sys/class/power_supply/*/state"
for THISFILE in $STATFILES ; do
if [ -e "$THISFILE" ] ; then
log "STATUS" "$THISFILE:"
if [ -r "$THISFILE" ] ; then
cat "$THISFILE" | sed "s/^/ /"
else
log "STATUS" " Not accessible, permission denied - $0 needs to be run as root."
fi
log "STATUS" " "
fi
done
elif [ "$1" != "readconfig" -a "$1" != "defaults" ] ; then
KLEVEL="$(uname -r |
IFS='.-' read a b c
echo $a.$b
KMINOR="$(uname -r |
IFS='.-' read a b c d
# Strip any stuff from the end -- only the initial digits are part of the KMINOR.
echo $c | sed -e 's/\([[:digit:]]*\).*/\1/'
# Stop exporting everything -- what we do from here is private.
set +a
if [ "$1" = "--version" ] ; then
log "MSG" "Laptop Mode Tools $LMTVERSION"
exit 0
fi
if [ ! -e /proc/sys/vm/laptop_mode ] ; then
log "ERR" "Kernel does not have support for laptop mode. Please apply the laptop mode"
log "ERR" "patch or install a newer kernel."
exit 1
fi
if [ ! -w /proc/sys/vm/laptop_mode ] ; then
log "ERR" "You do not have enough privileges to enable laptop_mode."
exit 1
fi
INIT=0 # Display info in init script format?
FORCE=0 # Force reapplying the current state?
while [ "$1" != "" ] ; do
case "$1" in
init) INIT=1 ;;
force) FORCE=1 ;;
# Old options. We always do "auto" for any option now, but
# we still have to accept the options.
start) ;;
stop) ;;
auto) ;;
modules=*)
MODULES=$1
MODULES=${MODULES#"modules="}
devices=*)
DEVICES=$1
DEVICES=${DEVICES#"devices="}
*) log "ERR" "Unrecognized option $1."
exit 1 ;;
esac
shift
done
mkdir -p /var/run/laptop-mode-tools
# Used to display laptop mode state later on. This is the enabled/disabled
# state for laptop mode processing, it tells us nothing about whether laptop
# mode is actually _active_.
STATE=enabled
if [ "$ENABLE_LAPTOP_MODE_ON_BATTERY" -eq 0 -a "$ENABLE_LAPTOP_MODE_ON_AC" -eq 0 -a "$ENABLE_LAPTOP_MODE_WHEN_LID_CLOSED" -eq 0 ] ; then
STATE=disabled
fi
# Determine the power state.
# First try /sys/class/power_supply/*
FOUND_SYS_CLASS_POWER_SUPPLY_AC=0
ON_AC=0
for POWER_SUPPLY in /sys/class/power_supply/* ; do
if [ -f $POWER_SUPPLY/type ] ; then
if [ "$(cat $POWER_SUPPLY/type)" = "Mains" ] ;then
log "VERBOSE" "Determining power state from $POWER_SUPPLY/online."
FOUND_SYS_CLASS_POWER_SUPPLY_AC=1
if [ "$(cat $POWER_SUPPLY/online)" = 1 ] ; then
ON_AC=1
fi
fi
fi
done
if [ $FOUND_SYS_CLASS_POWER_SUPPLY_AC = 1 ] ; then
# Already found it!
log "VERBOSE" "Not trying other options, already found a power supply."
elif [ -d /proc/acpi/ac_adapter ] ; then
log "VERBOSE" "Determining power state from /proc/acpi/ac_adapter."
ADAPTERS_FOUND=0
ON_AC=0
for ADAPTER in /proc/acpi/ac_adapter/* ; do
if [ -f $ADAPTER/state ] ; then
ADAPTERS_FOUND=1
STATUS=`awk '/^state: / { print $2 }' $ADAPTER/state`
if [ "$STATUS" = "on-line" ] ; then
ON_AC=1
fi
fi
done
if [ "$ADAPTERS_FOUND" -eq 0 ] ; then
ON_AC=1
fi
elif [ -f /proc/pmu/info ] ; then
log "VERBOSE" "Determining power state from /proc/pmu/info."
if ( grep -q "^AC Power.*0$" /proc/pmu/info ) ; then
log "VERBOSE" "/proc/pmu/info indicates absence of AC power."
ON_AC=0
else
# It is possible that there is no AC Power = 1 in the file,
# but we always assume AC power when we're not sure.
ON_AC=1
log "VERBOSE" "/proc/pmu/info indicates presence of AC power."
fi
elif [ -f /proc/apm ] ; then
log "VERBOSE" "Determining power state from /proc/apm."
read D1 D2 D3 APM_AC_STATE D0 </proc/apm
if [ "$APM_AC_STATE" = "0x00" ] ; then
ON_AC=0
else
ON_AC=1
fi
else
log "VERBOSE" "No /sys/class/power_supply, ACPI, APM or PMU power management information found -- assuming AC power is present."
ON_AC=1
fi
# Determine whether to activate or deactivate laptop mode.
ACTIVATE=0
if [ "$ON_AC" -eq 1 ] ; then
if [ "$ENABLE_LAPTOP_MODE_ON_AC" -ne 0 ] ; then
log "VERBOSE" "On AC power: Activating, because ENABLE_LAPTOP_MODE_ON_AC is set."
ACTIVATE=1
else
log "VERBOSE" "On AC power: Deactivating, because ENABLE_LAPTOP_MODE_ON_AC is not set."
ACTIVATE=0
fi
else
if [ "$ENABLE_LAPTOP_MODE_ON_BATTERY" -ne 0 ] ; then
log "VERBOSE" "On battery power: Activating, because ENABLE_LAPTOP_MODE_ON_BATTERY is set."
ACTIVATE=1
else
log "VERBOSE" "On battery power: Deactivating, because ENABLE_LAPTOP_MODE_ON_BATTERY is not set."
ACTIVATE=0
fi
fi
if [ "$ENABLE_LAPTOP_MODE_WHEN_LID_CLOSED" -ne 0 -a "$ACTIVATE" -eq 0 ] ; then
if [ -x "`which hal-find-by-property`" ] ; then
HAL_LID_BUTTON=$(hal-find-by-property --key "button.type" --string "lid")
fi
if [ "$HAL_LID_BUTTON" != "" ] ; then
HAL_LID_BUTTON_STATE=$(hal-get-property --udi $(hal-find-by-property --key "button.type" --string "lid") --key "button.state.value")
if [ "$HAL_LID_BUTTON_STATE" = "true" ] ; then
log "VERBOSE" "Setting action to \"start\" because the lid is closed (says HAL)."
ACTIVATE=1
fi
elif [ -f /proc/acpi/button/lid/*/state ] ; then
if ( grep -q "closed" /proc/acpi/button/lid/*/state ) ; then
log "VERBOSE" 'Setting action to "start" because the lid is closed (says /proc/acpi/button/lid/*/state).'
ACTIVATE=1
fi
else
log "MSG" "Warning: ENABLE_LAPTOP_MODE_WHEN_LID_CLOSED is set, but there is no file"
log "MSG" "/proc/acpi/button/lid/.../state, and hal information is not available either!"
fi
fi
# If the init script has not been run or has been run with the "stop"
# argument, then we should never start laptop mode.
if [ ! -f /var/run/laptop-mode-tools/enabled ] ; then
log "VERBOSE" "Laptop mode disabled because /var/run/laptop-mode-tools/enabled is missing."
STATE=disabled
fi
if [ "$ACTIVATE" -eq 1 -a -f /etc/default/laptop-mode ] ; then
. /etc/default/laptop-mode
if ! ( echo "$ENABLE_LAPTOP_MODE" |grep y ) ; then
log "VERBOSE" "Not starting laptop mode because it is disabled in /etc/default/laptop-mode."
STATE=disabled
fi
fi
if [ "$STATE" = "disabled" ] ; then
ACTIVATE=0
fi
# Check whether we are allowed to activate the data-loss-sensitive stuff.
# If the battery charge is too low, we want to disable this, but not the
# other power-saving stuff.
if [ "$ACTIVATE" -eq 0 ] ; then
ACTIVATE_WITH_POSSIBLE_DATA_LOSS=0
elif [ "$ON_AC" = 1 ] ; then
log "VERBOSE" "On AC, not checking minimum battery charge."
ACTIVATE_WITH_POSSIBLE_DATA_LOSS=1
else
ACTIVATE_WITH_POSSIBLE_DATA_LOSS=1
ENOUGH_CHARGE=0
ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=0
# Weird way of checking that /sys/class/power_supply is not empty -- but it works.
if [ "$(echo /sys/class/power_supply/*)" != '/sys/class/power_supply/*' ] ; then
log "VERBOSE" "Not on AC and we have battery information in /sys/class/power_supply/BAT* -- checking minimum battery charge."
for BATT in /sys/class/power_supply/* ; do
BATT_TYPE=$(cat $BATT/type)
log "VERBOSE" "$BATT is of type $BATT_TYPE."
if [ "$BATT_TYPE" != "Battery" ] ; then
log "VERBOSE" "Not of type \"Battery\", skipping."
else
PREV_ENOUGH_CHARGE=$ENOUGH_CHARGE
PREV_ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=$ENOUGH_CHARGE_TO_PREVENT_HIBERNATION
log "VERBOSE" "Checking levels for $BATT."
PRESENT=$(cat $BATT/present)
log "VERBOSE" "Present: $PRESENT."
# Only do if the battery is present
if [ "$PRESENT" -eq 1 ] ; then
FOUND_AN_ENABLED_CHECK=0
FOUND_AN_ENABLED_HIBERNATION_CHECK=0
# Get the remaining capacity.
IN_UAH=0
IN_UWH=0
if [ -f $BATT/charge_now ] ; then
REMAINING=$(cat $BATT/charge_now)
IN_UAH=1 # charge_* is in microAmpere-hours
elif [ -f $BATT/energy_now ] ; then
REMAINING=$(cat $BATT/energy_now)
IN_UWH=1 # energy_* is in microWatt-hours
else
REMAINING=0
fi
if [ -z "$REMAINING" -o "$REMAINING" -eq 0 ] ; then
log "VERBOSE" "Battery does not report remaining charge. Perhaps it is not present?"
REMAINING=0
fi
log "VERBOSE" "Remaining charge: $REMAINING"
if [ -f $BATT/charge_full_design ] ; then
CAPACITY=$(cat $BATT/charge_full_design)
elif [ -f $BATT/energy_full_design ] ; then
CAPACITY=$(cat $BATT/energy_full_design)
else
CAPACITY=0
fi
if [ -z "$CAPACITY" -o "$CAPACITY" -eq 0 ] ; then
log "VERBOSE" "Battery does not report design full charge, using non-design full charge."
if [ -f $BATT/charge_full ] ; then
CAPACITY=$(cat $BATT/charge_full)
elif [ -f $BATT/energy_full_design ] ; then
CAPACITY=$(cat $BATT/energy_full)
else
CAPACITY=0
fi
if [ -z "$CAPACITY" -o "$CAPACITY" -eq 0 ] ; then
log "VERBOSE" "Battery does not report non-design full charge."
CAPACITY=0
fi
fi
log "VERBOSE" "Full capacity: $CAPACITY"
# Check the charge percentage
if [ "$MINIMUM_BATTERY_CHARGE_PERCENT" -ne 0 ] ; then
FOUND_AN_ENABLED_CHECK=1
if [ "$CAPACITY" -eq 0 ] ; then
log "MSG" "WARNING: Battery does not report a capacity. Minimum battery"
log "MSG" "charge checking does not work without a design capacity."
ENOUGH_CHARGE=1
elif [ "$(($REMAINING * 100 / $CAPACITY))" -ge "$MINIMUM_BATTERY_CHARGE_PERCENT" ] ; then
ENOUGH_CHARGE=1
fi
fi
if [ "$AUTO_HIBERNATION_BATTERY_CHARGE_PERCENT" -ne 0 ] ; then
FOUND_AN_ENABLED_HIBERNATION_CHECK=1
if [ "$CAPACITY" -eq 0 ] ; then
log "MSG" "WARNING: Battery does not report a design capacity. Auto hibernation"
log "MSG" "does not work without a design capacity."
ENOUGH_CHARGE=1
elif [ "$(($REMAINING * 100 / $CAPACITY))" -ge "$AUTO_HIBERNATION_BATTERY_CHARGE_PERCENT" ] ; then
ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=1
fi
fi
# $BATT/alarm is the design_capacity_warning of a battery.
ALARM_LEVEL=$(cat $BATT/alarm)
if [ "$ALARM_LEVEL" -ne 0 ] ; then
if [ "$REMAINING" -le "$ALARM_LEVEL" ] ; then
# Restore the state we had before checking this battery, so that
# this battery does not count as having enough charge.
ENOUGH_CHARGE=$PREV_ENOUGH_CHARGE
elif [ "$FOUND_AN_ENABLED_CHECK" -eq 0 ] ; then
# This is the only check that is enabled. In that case a non-critical
# battery level counts as "enough". (If we would count non-critical
# battery levels as enough *always*, then the other settings would
# have no effect; this is only a final fallback.)
ENOUGH_CHARGE=1
fi
fi
if [ "$AUTO_HIBERNATION_ON_CRITICAL_BATTERY_LEVEL" -ne 0 ] ; then
if [ "$REMAINING" -le "$ALARM_LEVEL" ] ; then
ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=$PREV_ENOUGH_CHARGE_TO_PREVENT_HIBERNATION
elif [ "$FOUND_AN_ENABLED_HIBERNATION_CHECK" -eq 0 ] ; then
ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=1
fi
fi
# Fallback: hard values
if [ "$IN_UAH" -ne 0 ] ; then
if [ "$MINIMUM_BATTERY_CHARGE_MAH" -ne 0 ] ; then
FOUND_AN_ENABLED_CHECK=1
if [ "$REMAINING" -ge $((1000*"$MINIMUM_BATTERY_CHARGE_MAH")) ] ; then
ENOUGH_CHARGE=1
fi
fi
if [ "$AUTO_HIBERNATION_BATTERY_CHARGE_MAH" -ne 0 ] ; then
FOUND_AN_ENABLED_HIBERNATION_CHECK=1
if [ "$REMAINING" -ge $((1000*"$AUTO_HIBERNATION_BATTERY_CHARGE_MAH")) ] ; then
ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=1
fi
fi
elif [ "$IN_UWH" -ne 0 ] ; then
if [ "$MINIMUM_BATTERY_CHARGE_MWH" -ne 0 ] ; then
FOUND_AN_ENABLED_CHECK=1
if [ "$REMAINING" -ge $((1000*"$MINIMUM_BATTERY_CHARGE_MWH")) ] ; then
ENOUGH_CHARGE=1
fi
fi
if [ "$AUTO_HIBERNATION_BATTERY_CHARGE_MWH" -ne 0 ] ; then
FOUND_AN_ENABLED_HIBERNATION_CHECK=1
if [ "$REMAINING" -ge $((1000*"$AUTO_HIBERNATION_BATTERY_CHARGE_MWH")) ] ; then
ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=1
fi
fi
else
log "ERR" "Failed to determine battery charge. Battery charge units are not in"
log "ERR" "mWh, uWh, mAh or uAh."
fi
else
log "VERBOSE" "Battery is not present."
fi
fi
done
elif [ "$(echo /proc/acpi/battery/*)" != '/proc/acpi/battery/*' ] ; then
log "VERBOSE" "Not on AC and we have batteries in /proc/acpi/battery -- checking minimum battery charge."
for BATT in /proc/acpi/battery/* ; do
PREV_ENOUGH_CHARGE=$ENOUGH_CHARGE
PREV_ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=$ENOUGH_CHARGE_TO_PREVENT_HIBERNATION
BATT_STATE=$BATT/state
BATT_INFO=$BATT/info
log "VERBOSE" "Checking info and state for $BATT."
# Only do if the battery is present
if ( grep -q 'present:.*yes' $BATT_INFO ) ; then
FOUND_AN_ENABLED_CHECK=0
FOUND_AN_ENABLED_HIBERNATION_CHECK=0
# Get the remaining capacity.
REMAINING=`grep "remaining capacity:" $BATT_STATE | sed "s/.* \([0-9][0-9]* \).*/\1/" `
if [ -z "$REMAINING" ] ; then
log "VERBOSE" "Battery does not report remaining charte. Perhaps it is not present?"
REMAINING=0
fi
log "VERBOSE" "Remaining charge: $REMAINING"
CAPACITY=`grep "design capacity:" $BATT_INFO | sed "s/.* \([0-9][0-9]* \).*/\1/" `
if [ -z "$CAPACITY" ] ; then
log "VERBOSE" "Battery does not report capacity. Perhaps it is not present?"
CAPACITY=0
fi
log "VERBOSE" "Design capacity: $CAPACITY"
# Check the charge percentage
if [ "$MINIMUM_BATTERY_CHARGE_PERCENT" -ne 0 ] ; then
FOUND_AN_ENABLED_CHECK=1
if [ "$CAPACITY" -eq 0 ] ; then
log "MSG" "WARNING: Battery does not report a design capacity. Minimum battery"
log "MSG" "charge checking does not work without a design capacity."
ENOUGH_CHARGE=1
elif [ "$(($REMAINING * 100 / $CAPACITY))" -ge "$MINIMUM_BATTERY_CHARGE_PERCENT" ] ; then
ENOUGH_CHARGE=1
fi
fi
if [ "$AUTO_HIBERNATION_BATTERY_CHARGE_PERCENT" -ne 0 ] ; then
FOUND_AN_ENABLED_HIBERNATION_CHECK=1
if [ "$CAPACITY" -eq 0 ] ; then
log "MSG" "WARNING: Battery does not report a design capacity. Auto hibernation"
log "MSG" "does not work without a design capacity."
ENOUGH_CHARGE=1
elif [ "$(($REMAINING * 100 / $CAPACITY))" -ge "$AUTO_HIBERNATION_BATTERY_CHARGE_PERCENT" ] ; then
ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=1
fi
fi
# Fallback: hard values.
# Determine the reporting unit.
IN_MAH=0
IN_MWH=0
if ( grep -q mWh $BATT_INFO ) ; then
IN_MWH=1
elif ( grep -q mAh $BATT_INFO ) ; then
IN_MAH=1
fi
if [ "$IN_MAH" -ne 0 ] ; then
if [ "$MINIMUM_BATTERY_CHARGE_MAH" -ne 0 ] ; then
FOUND_AN_ENABLED_CHECK=1
if [ "$REMAINING" -ge "$MINIMUM_BATTERY_CHARGE_MAH" ] ; then
ENOUGH_CHARGE=1
fi
fi
if [ "$AUTO_HIBERNATION_BATTERY_CHARGE_MAH" -ne 0 ] ; then
FOUND_AN_ENABLED_HIBERNATION_CHECK=1
if [ "$REMAINING" -ge "$AUTO_HIBERNATION_BATTERY_CHARGE_MAH" ] ; then
ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=1
fi
fi
elif [ "$IN_MWH" -ne 0 ] ; then
if [ "$MINIMUM_BATTERY_CHARGE_MWH" -ne 0 ] ; then
FOUND_AN_ENABLED_CHECK=1
if [ "$REMAINING" -ge "$MINIMUM_BATTERY_CHARGE_MWH" ] ; then
ENOUGH_CHARGE=1
fi
fi
if [ "$AUTO_HIBERNATION_BATTERY_CHARGE_MWH" -ne 0 ] ; then
FOUND_AN_ENABLED_HIBERNATION_CHECK=1
if [ "$REMAINING" -ge "$AUTO_HIBERNATION_BATTERY_CHARGE_MWH" ] ; then
ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=1
fi
fi
else
log "ERR" "Failed to determine battery charge. Battery charge units are not in"
log "ERR" "mWh or mAh."
fi
CAP_STATE=`sed -r 's/^capacity state:\s*(.*)\s*$/\1/;t;d' "$BATT_STATE"`
if [ "$DISABLE_LAPTOP_MODE_ON_CRITICAL_BATTERY_LEVEL" -ne 0 ] ; then
if [ "$CAP_STATE" = "critical" ] ; then
# Restore the state we had before checking this battery, so that
# this battery does not count as having enough charge.
ENOUGH_CHARGE=$PREV_ENOUGH_CHARGE
elif [ "$FOUND_AN_ENABLED_CHECK" -eq 0 ] ; then
# This is the only check that is enabled. In that case a non-critical
# battery level counts as "enough". (If we would count non-critical
# battery levels as enough *always*, then the other settings would
# have no effect; this is only a final fallback.)
ENOUGH_CHARGE=1
fi
fi
if [ "$AUTO_HIBERNATION_ON_CRITICAL_BATTERY_LEVEL" -ne 0 ] ; then
if [ "$CAP_STATE" = "critical" ] ; then
ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=$PREV_ENOUGH_CHARGE_TO_PREVENT_HIBERNATION
elif [ "$FOUND_AN_ENABLED_HIBERNATION_CHECK" -eq 0 ] ; then
ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=1
fi
fi
else
log "VERBOSE" "Battery is not present."
fi
done
else
ENOUGH_CHARGE=1
ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=1
log "VERBOSE" "Not on AC and could not check battery state -- data loss sensitive features stay enabled and auto-hibernation will not work."
fi
if [ "$ENABLE_AUTO_HIBERNATION" -ne 0 -a "$ENOUGH_CHARGE_TO_PREVENT_HIBERNATION" -eq 0 ] ; then
log "VERBOSE" "None of the batteries have a charge above the auto-hibernation level."
log "VERBOSE" "Starting hibernation."
if [ -x $HIBERNATE_COMMAND ]; then
$HIBERNATE_COMMAND
elif [ -f /sys/power/state ]; then
grep -q disk /sys/power/state && echo disk > /sys/power/state
fi
# Don't continue -- if things are configured correctly, then we
# will be called on resume.
exit 0
fi
if [ "$ENOUGH_CHARGE" -eq 0 ] ; then
log "VERBOSE" "None of the batteries have a charge above the minimum level."
log "VERBOSE" "Deactivating data loss sensitive features."
ACTIVATE_WITH_POSSIBLE_DATA_LOSS=0
fi
fi
if [ "$INIT" -eq 0 ] ; then
log "MSG" "Laptop mode "
fi
# WAS_ACTIVE is used later on. If there is no /var/run/laptop-mode-tools/state, then
# we know that laptop mode wasn't active before.
WAS_ACTIVE=0
log "VERBOSE" "Checking if desired state is different from current state."
if [ -f /var/run/laptop-mode-tools/state ] ; then
read WAS_ACTIVE WAS_ON_AC WAS_ACTIVATE_WITH_POSSIBLE_DATA_LOSS WAS_STATE < /var/run/laptop-mode-tools/state
if [ "$WAS_STATE" != "" ] ; then
if [ "$WAS_ACTIVE" -eq "$ACTIVATE" -a "$WAS_ON_AC" -eq "$ON_AC" -a "$WAS_ACTIVATE_WITH_POSSIBLE_DATA_LOSS" -eq "$ACTIVATE_WITH_POSSIBLE_DATA_LOSS" -a "$WAS_STATE" = "$STATE" -a "$FORCE" -eq 0 ] ; then
log "MSG" "$STATE, "
if [ "$WAS_ACTIVE" -eq 1 ] ; then
log "MSG" "active [unchanged]"
if [ "$ACTIVATE_WITH_POSSIBLE_DATA_LOSS" -eq 0 ] ; then
log "MSG" " (Data-loss sensitive features disabled.)"
fi
else
log "MSG" "not active [unchanged]"
fi
exit 0
fi
fi
else
log "VERBOSE" "/var/run/laptop-mode-tools/state does not exist, no previous state."
fi
echo "$ACTIVATE $ON_AC $ACTIVATE_WITH_POSSIBLE_DATA_LOSS $STATE" > /var/run/laptop-mode-tools/state
if [ "$ACTIVATE" -eq 1 ] ; then
log "MSG" "$STATE, active"
if [ "$ACTIVATE_WITH_POSSIBLE_DATA_LOSS" -eq 0 ] ; then
log "MSG" " (Data-loss sensitive features disabled.)"
fi
else
log "MSG" "$STATE, not active"
fi
# Finally, call laptop-mode-tools modules. The modules can use the settings
# from the config files, but they may NOT assume the settings actually exist,
# as no defaults have been given for them.
# Note that the /usr/local/lib path is deprecated.
export FORCE STATE ON_AC ACTIVATE ACTIVATE_WITH_POSSIBLE_DATA_LOSS KLEVEL KMINOR WAS_ACTIVE LM_VERBOSE DEVICES
for SCRIPT in /usr/share/laptop-mode-tools/modules/* /usr/local/lib/laptop-mode-tools/modules/* /usr/local/share/laptop-mode-tools/modules/* /etc/laptop-mode/modules/* ; do
if [ -z "$MODULES" ] ; then
# If a module list has not been provided, execute all modules
EXECUTE_SCRIPT=1
else
# If a module list has been provided, execute only the listed
# modules.
EXECUTE_SCRIPT=0
for MODULE in $MODULES; do
# Attempt to remove the module name from the end of the
# full script path. If the module name matches the
# script, the name will be removed from the end of the
# full file path, leaving the path to the script. If
# there was not a match made, the module name would not
# be removed from the path, and $PATH_TO_SCRIPT would
# be the same as $SCRIPT.
PATH_TO_SCRIPT=${SCRIPT%%$MODULE}
# Execute the script if a match was found (module name
# was removed from the script path, making it shorter.
if [ $PATH_TO_SCRIPT != $SCRIPT ] ; then
EXECUTE_SCRIPT=1
fi
done
fi
if [ -x "$SCRIPT" -a $EXECUTE_SCRIPT -eq 1 ] ; then
log "VERBOSE" "Invoking module $SCRIPT."
SCRIPT_DEBUG=$SCRIPT; # We do this because in start-stop-programs module a $SCRIPT variable is used. That
# changes the whole meaning when passed to disableDebug ()
enableDebug $SCRIPT_DEBUG;
. $SCRIPT
disableDebug $SCRIPT_DEBUG;
else
log "VERBOSE" "Module $SCRIPT is not executable or is to be skipped."
fi
done
exit 0
# This fi closes the if for "readconfig". If I would have indented this one
# I would have indented the whole file. :)
fi
lmt_load_config
lock_retry ()
( $FLOCK -n -x -w 1 8 || exit 0;
i=10;
while [ $i -ge 1 ]
do
log "ERR" "Couldn't acquire lock. Retrying.... PID is $$\n"
$FLOCK -x -w 1 9 && lmt_main_function "$@" && break;
i=$(( $i - 1 ))
done
) 8>$LMT_REQ_LOCK
# Check and acquire locks and then exec.
( $FLOCK -n -x -w 1 8; ) 8>$LMT_REQ_LOCK
($FLOCK -n -x -w 1 9 && lmt_main_function "$@";) || lock_retry "$@"
) 9<>$LMT_INVOC_LOCK
# We do a special run of battery polling daemon here so that it does not get
# plagued by the lock. We need the polling daemon to be independent of any locks
if [ x$ENABLE_BATTERY_LEVEL_POLLING = x1 ] && [ x$BLACKLIST_IN_FLOCK = x1 ]; then
log "VERBOSE" "Battery level polling is enabled."
if [ x$ON_AC = x1 ] ; then
log "VERBOSE" "On AC, stopping the polling daemon."
# In AC mode we disable the polling daemon.
killall -q lm-polling-daemon
else
if ! pidof -x lm-polling-daemon ; then
log "VERBOSE" "On battery and there was no polling daemon yet, starting the polling daemon."
# If there is no polling daemon, we start one.
/usr/share/laptop-mode-tools/module-helpers/lm-polling-daemon < /dev/null > /dev/null 2> /dev/null &
fi
fi
else
log "VERBOSE" "Battery level polling is disabled."
fi
exit 0;
and here is the lines which archwiki mentions
case "$KLEVEL" in
"2.4" ) ;;
"2.6" ) ;;
log "ERR" "Unhandled kernel version: $KLEVEL ('uname -r' = '$(uname -r)')" >&2
exit 1
esacI had the problem but edited the line in /usr/sbin/laptop_mode and it worked. But thoes lines are not there anymore. I guess they changed it at the recent update of laptop-mode-tools.
Regarding your heat problem; is there any other thing you use to cut down power usage (from AUR maybe)? I use acpi_call from AUR had to edit lines there aswell, but it should be updated by now.
Maybe you are looking for
-
No output sound from output port/analog audio: Need help
hello, I want to connect my analog audio equipment to my iMac. I have done this in the past with my old G3. I have connected the RCA cables to a 3.5 mm jack and put it into the audio input port, which was what worked on the G3. When I open the sound
-
Changing size area with help of mouse for custom tree control....
Hi, I was creating a module pool program where I get tree control on left handise and HTML viewer on right hand side taking the help of example 'SAPSIMPLE_TREE_CONTROL_DEMO' . But I wanted the left hand side custom control adjustable i.e I move the s
-
I am having difficulty connecting to Designer of the Dev Suite. I am prompted for a username, password and host string. I did not setup any of these during installation. My error codes are ORA 12560 : TNS:protocol adapter error. Cause: a generic prot
-
Weblogic, data services, flex, flash
Hello world! I have folowing task: I need to create very simple application using Flash Builder with Flex, Oracle Database and WebLogic Server. No matter what application, let it be empty for the begining. So, first I need to install LiveCycle Data S
-
I used to have the option to "empty my cache" and it has suddenly dissapeared
I used to have an option to "empty my cache" and it has suddenly disappeared? Any suggestions??