Difference between revisions of "Pcad"

From ProgClub
Jump to: navigation, search
(Bankruptcy, Is It A Way Out)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Negotiations with creditors have failed. Repossession will be imminent and foreclosure proceedings have begun. Your income will be not sufficient to pay your bills, irrespective of how low the payments are. It could end up being time to consider bankruptcy.  
+
Pcad is the ProgClub administration daemon software. That's the software that does various administration things when a non-privileged user asks for them to be done. For example, it can recreate some MySQL databases on your behalf. For other projects see [[Projects]].
+
 
Bankruptcy law evolved because a reaction to the abuses surrounding debtors prison. Before the nineteenth century a prison system existed for these who didn'big t pay their bills. In case a merchant filed a claim, the debtor has been incarcerated till his financial obligations were paid. (Women were not within debtor's prison, not because of chivalry but because they did riot have the ability to be lent). The lender were rightly liable for the expenses with the prison stay, including nutrients, but seldom paid. After all, a debtor would have to sue as a way to enforce it law, and it ended up being rather difficult to sue when in prison. As a result, many credit seekers languished in prison for a long time, surviving on what their family could bring to them or, in many cases, just starving to death. However some lenders would doubtless not object to the renewal of debtor'utes prison, fortunately we are living in a lot more enlightened times. Bankruptcy had been created to provide a second opportunity (or third, or 4th) to those types of hopelessly in debt It provides a mechanism to wipe the slate clean and begin anew. Because times have transformed, though, so contains the bankruptcy code. Not almost all financial obligations could be wiped out. The proceedings may be quite easily disqualified in the event of improper processes. There are many things a debtor should understand before resorting to bankruptcy.  
+
== Project status ==
+
 
The Bankruptcy Decision
+
Under way. Not released yet, there's stuff [[Pcad#TODO|TODO]].
   
+
 
There are two sorts of individual bankruptcy: Chapter 7 and Chapter 13. Chapter 7 bankruptcy, named for the chapter number in the bankruptcy program code, requires an entire liquidation of most debts and cancels every single one no-exempt bad debts. Chapter 13 bankruptcy is actually essentially a court-mandated payment package that sets up affordable monthly payments to your creditors,
+
== Contributors ==
+
 
The decision to declare bankruptcy will be not a pretty simple one. Regrettably, many bankruptcy attorneys recommend bankruptcy to just about any person they will check with with. Just about all too often frightened buyers are advised to declare bankruptcy just to steer clear of a few debts. This really is a mistake. Bankruptcy should truly be a last vacation resort like the legal system meant it to always be. A bankruptcy appears on your credit for twelve years, and despite the fact that lending criteria are little by little changing, many lenders won't even consider an applicant who seems to have had a bankruptcy. What's much more, a Chapter 7 bankruptcy can cost you every one of your property. Before making a choice to declare bankruptcy, estimate just how harmful your situation really is actually. On a piece of document, make a listing of just about all your assets and the approximate value these people could be sold for. On the other side, always make sense all of your financial obligations. If the bad debts exceed the assets by a large percent, you may wish to consider bankruptcy. On the other hands, if it seems the fact that situation may improve (you may get a brand new job or a second income), or if your assets are of greater value or close in value to your debts, a different approach may always be appropriate.
+
Members who have contributed to this project. Newest on top.
+
 
Discuss with your creditors
+
* [[User:SanguineV|SanguineV]]
   
+
* [[User:John|John]]
Explain your situation and make sure you ask for a lot more time to pay. If the creditors refuse and continue to threaten garnishment advise them this kind of motion would force you into bankruptcy. No creditor is looking to hear the "B" term. Using bankruptcy since a threat is actually a very powerful negotiating device, confronting creditors with a choice between obtaining a little every month or possibly acquiring nothing through bankruptcy. Don'testosterone try this tactic on attached creditors. That they may choose to repossess your property to prevent having to use up court.
+
 
+
All contributors have agreed to the terms of the [[ProgClub:Copyrights#ProgClub_projects|Contributor License Agreement]]. This excludes any upstream contributors who tend to have different administrative frameworks.
Contact Consumer Credit Counseling
+
 
+
== Copyright ==
As mentioned earlier in the book, Customer Credit score Counseling will be a non-profit group funded by creditors to help customers work repayment plans. It is truly often able to work payment arrangements better than the individual because of their constant contact with a variety of creditors. If you can'big t discuss a satisfactory arrangement, offer these people a try. Remember, the proven fact that you are using credit counseling may appear on your credit rating record.  
+
 
+
Copyright 2011-2012, [[Pcad#Contributors|Contributors]].
Consider Chapter 13 bankruptcy
+
 
+
== License ==
This particular kind of filing enables you to repay your debts in a court-mandated fashion and will appear on your credit record for only seven a long time, If negotiations fail or there just isn'big t adequate money to make ends meet Chapter 7 bankruptcy may always be your only option. Bankruptcy is not going to necessarily discharge most financial obligations. If your financial obligations are exempt through bankruptcy, filing will carry out hardly any to improve your situation. If your co-signer was used, the debt would then be owed through the co-signer, unless that individual in addition expressed bankruptcy. In community property states a wife or husband's assets and financial obligations would also be included in the bankruptcy, assuming they are community property. Consider most very carefully before deciding to report.  
+
 
+
Licensed under the [[New BSD license]].
Non-Dischargable Bad debts - Bills You Have To Pay In Spite Of Bankruptcy
+
 
   
+
== Source code ==
Selected varieties of debt is not automatically taken away by bankruptcy filing. That they must meet selected requirements before being eliminated by bankruptcy. If almost all of your debts are non-dischargeable, bankruptcy may not correct your economic dilemma. Your only ways a non-dischargeable debt might be removed through bankruptcy are through a great exception being granted through the court, a certain period of time transpiring considering that the debt had been due, or because the creditor will not object to the discharging with the debt. Specific bad debts can only end up being discharged by a helpful exception. They're:
+
 
   
+
The repository can be browsed online:
Recent Student loans
+
 
   
+
http://www.progclub.org/pcrepo/pcad/
This kind of can be applied to student loans that became due within the last five a long time. Any extension of repayment would always be added to this unique period. Some courts, furthermore, is only going to discharge payments that tend to be than five numerous years overdue. Therefore the student loan was due seven quite a few years ago and the payments were initially to become made over a five-year period, you would still be dependable for the last three a long time of payments. The court may additionally grant a great exception to your university student loan if it would produce a great "undue hardship" for you to definitely pay it. That is hardly ever naturally.  
+
 
+
The code for pcad is publicly available from svn:
Taxes
+
 
+
http://www.progclub.org/svnro/pcrepo/pcad/tags/latest
Federal, condition, and community taxes are not dischargeable for at least three numerous years after you report your duty go back. Even if you've been tied way up in taxes court for a lot more than three numerous years, any tax assessed within 240 days of filing for bankruptcy is actually non-dischargeable. Property taxes are dischargeable when they are over 1 year late, but the lien towards your property is actually not. The bottom delicate will be which you can count on the government collecting it's duty money eventually.  
+
 
+
Or privately available for read-write access:
Child Support and alimony
+
 
+
  https://www.progclub.org/svn/pcrepo/pcad/trunk/
These can only be discharged in special circumstances, which generally include agreements that have not been court-ordered. If one particular soon-to-be ex seems to have agreed to assume more than 50 % of marital debts in exchange for lower help payments, the court may not discharge all debts held from the soon-to-be ex for bankruptcy. Check with an attorney if this particular situation relates.
+
 
+
== Links ==
Fines
+
 
   
+
* [http://blog.emptycrate.com/node/219 Making a Linux Daemon]
Neither fines through a court, judge, or federal government agency nor surcharges, charges, and restitution, as a standard rule, can be discharged in a bankruptcy. The same is actually correct of bad debts incurred as a result of damage or liability coming from driving while intoxicated. The debt incurred through intoxicated driving should be established in court and also a judgment should be issued by a higher court. Little-claims, targeted traffic, and municipal judgments for intoxicated driving are almost all dischargeable. Yet again, look for advice a good lawyer.
+
* [http://www.linuxhowtos.org/C_C++/socket.htm Sockets Tutorial]
+
* [http://www.paulgriffiths.net/program/c/echoserv.php Simple TCP/IP echo server]
Debts not discharged in a previous bankruptcy
+
 
+
== Functional specification ==
If debts coming from a previous bankruptcy have been found non-dischargeable, they will will not be discharged in a later bankruptcy.
+
 
+
There are two components to this software, the client, and the server.
Bad debts not detailed on your bankruptcy petition
+
 
+
=== Pcad server ===
If you may not include a debt on your petition, it will never always be discharged. Many people filing bankruptcy carry on one or much more credit score lines with tiny balances or no balance out of the bankruptcy proceeding to preserve part of their credit score resources. Another method is to reaffirm financial obligations on the condition that credit rating remains to be offered. The creditor, confronted with a choice between gathering nothing and maintaining your credit rating, will sometimes presents latter. Become very mindful when reaffirming debt. Near someone obligated to and you also must have a new written arrangement spelling out every one of the brand new conditions.
+
 
+
The server runs as a daemon process and listens on a TCP/IP port for incoming requests. It parses the requests to find the command. The command must correspond to an executable script in the /etc/pcad/command/ directory. If there is a matching command script then when the server gets a request for that command it runs the corresponding script as root.
Other sort of non-dischargeable debts could be discharged immediately if the creditor is not going to object If the creditor objects, these debts will probably be judged from the court to be either dischargeable or non-dischargeable. The creditor can inquire that the debts not always be discharged if they claim the following conditions existed:
+
 
+
=== Pcad client ===
The debt was acquired by Intentionally fraudulent behavior
+
 
+
The client is a Linux command that accepts a host, port and command. In the future maybe we'll also support command arguments, but that's not a goal for the first version. So the client might accept a command like this:
Fraud in this particular case is any dishonest behave used to obtain credit rating. Declaring to always be a person you are not, or borrowing money when you have no means or intention of repaying it, would be clear-cut examples of fraud. Not disclosing specific relevant facts could furthermore be construed like fraud. If you're making a promise and intend to preserve it and believe you will be able to remain it, that is not fraud. Creditors tend to always be paranoid and believe everyone will be defrauding them, so this excuse for non-discharge will be often employed by creditor'ersus attorneys.
+
 
+
  $ pcad-request localhost 12345 recreate-test-database
Debts Incurred because a Result of False Written Statements
+
 
+
This would send the 'recreate-test-database' command to the pcad server running on the localhost. The server would then receive this command and process the script /etc/pcad/command/recreate-test-database. The pcad-request command blocks until the server has finished processing the request and returns an error level indicating success or error.
A blatantly false credit score application would qualify. The inaccurate statement should be a good important fact then one that the creditor relied on so as for the debt to be judged non-dischargeable. A misspelled name or minor error would not render a debt non-dischargeable. Drastically overstating income or misrepresent a job title would always be considered fraudulent.
+
 
+
There will be another client command, pcad-async, which works the same way as pcad-request except that pcad-async does not block until completion of the command, rather it returns immediately after registering a command with the server, and the server will process the command in the background. The pcad-async command returns an error level indicating an error if the command is invalid, if the command is valid and accepted by the server then the error level is zero.
Fraudulent usage
+
 
+
=== Thoughts ===
If you charge "luxury goods or services" in the amount over $5 hundred within 40 times before filing bankruptcy, the debt is truly probably to end up being deemed non-dischargeable. The same will be correct if money advances are obtained fewer than twenty times before declaring bankruptcy. A lots of simple charges, made to avoid pre-clearance, would also become considered fraudulent had you been over your credit score reduce or obviously unable to pay.
+
 
+
Maybe it would be better to give a host name to the client and then have the client lookup the host and port in a config file. For instance there might be a config file in /etc/pcad/client that looks like this:
Financial obligations resulting coming from unlawful or malicious operates, embezzlement, larceny, or breach of fiduciary Obligation
+
 
+
localhost: localhost 12345
Any money owed because of illegal shows these kinds of while embezzlement (swallowing property left in the safekeeping), larceny (theft), or the losing to fulfill your duties while a trustee can be non-dischargeable. The court will generally de a definition of fiduciary responsibility.
+
 
+
The client could then accept commands for localhost and lookup the host name in the config file to determine which server to connect to. This would simplify client code that needed to be reconfigured to use a different port.
Once you've examined your debts and determined what is dischargeable and what is truly not, you can decide whether or not bankruptcy would enhance your current monetary situation. There are numerous other things you should know before you decide if to report.
+
 
+
== Technical specification ==
Exempt Assets
+
 
+
The pcad client commands and the server will be implemented in C.
The sole misconception about bankruptcy is truly that you just lose everything you unique to satisfy your debts. In fact, the court enables one particular keep many things essential to your well being, and perhaps even a little bit a lot more. Although there will be a federal exemption law, only in states and the District of Columbia allow people to put it to use These states let you finally choose between the state and federal exemption protocols. The in states are:
+
 
+
=== Pcad persistent daemon ===
Connecticut
+
 
+
The pcad server will run as a persistent daemon with something like the following in /etc/inittab
Hawaii
+
 
+
  ad:12345:respawn:/usr/local/sbin/pcad-server
Massachusetts
+
 
+
To force a reload of the inittab file by the init process:
Michigan
+
 
+
# kill -HUP 1
Minnesota
+
 
+
=== Pcad network protocol ===
Brand-new Jersey
+
 
+
==== Request ====
New Mexico
+
 
+
A request is simply a line of text containing the execution type, followed by a space, followed by the name of the command. The supported execution types are "sync" and "async". So a stream that invoked the recreate-test-database command synchronously would use a network request that looked like this:
Pennsylvania
+
 
+
  sync recreate-test-database
Rhode Island
+
 
+
Or if it was an async request:
Texas
+
 
+
  async recreate-test-database
Washington
+
 
+
==== Response ====
Wisconsin
+
 
+
A response is a line of text containing the error level, e.g. 0 or 1. After the error level is any text returned on the standard output or standard error streams when the command was run. In the case of an async request the output can be either an error message or nothing.
Vermont
+
 
+
==== Thoughts ====
The other states require a person filing bankruptcy to use express exemptions.
+
 
+
There might be a problem with the network connection timing out for long running requests. If the network connection times out the client should return an error level indicating failure. It might be nice to have the server fire up a thread that outputs "." characters every second while the command is being processed. If we do that then the response protocol will have a line of zero or more dots, followed by a line indicating the error level, followed by any output.
Listed below are instances of things that might always be exempt, based on state through which the petition is truly filed.
+
 
+
=== Security ===
· Personal consequences
+
 
+
It might be best to run the pcad-server as a user 'pcad' rather than 'root'. This can be done using sudo in the inittab, e.g.
· Furniture
+
 
+
ad:12345:respawn:/usr/bin/sudo -u pcad /usr/local/sbin/pcad-server
· Cars (to a max of a certain amount of equity)
+
 
+
The pcad-server would then need to have permission to launch its command scripts as root. This can be accomplished by running the visudo command and adding a line such as the following:
· Tools of the trade
+
 
+
  pcad localhost=/etc/pcad/command/*
· Equity m a residence (at times the complete residence)
+
 
+
If we do it this way the server will need to support executing scripts with sudo. We'd also need to make sure that the pcad user didn't have write access to the /etc/pcad/command/ directory.
· Garments
+
 
+
== TODO ==
· Household goods
+
 
+
Things to do, in rough order of priority:
· Publications
+
 
+
* Make the executable code run forever
· Jewelry
+
* Make the executable a managed daemon process that gets started and stopped properly
+
* Add support from recreating pcphpjs-dev database
A single very interesting exemption may be the homestead exemption. When Bob Connally, the former governor of Texas, declared bankruptcy a couple of years ago, many people were surprised that he were granted to carry on his huge mansion, valued at several million dollars. Texas offers a homestead exemption that allows everyone petitioning bankruptcy to maintain equal to a single acre in a good urban area or 100 acres in a rural area, no matter value. The ex-governor may have had a very good attorney, but many other states furthermore offer homestead exemptions.
+
 
+
== Done ==
1 bankruptcy method should be to sell non-exempt property before bankruptcy and convert it into exempt property. For case in point, a Texas resident might sell non-exempt assets and use the proceeds to pay off your home mortgage on her homesteaded property. You would almost certainly want to check with a good lawyer before attempting this particular kind of transfer of assets, anyhow, because the court could very very easily view this kind of action just as one abuse from the bankruptcy legal guidelines.
+
 
+
Stuff that's done. Latest stuff on top.
Even if a particular amount of equity is truly exempt, your creditors can often sell the resource to retrieve any excess equity you may have. If you possess an auto worth $15,000, for case in point, and you only owe $5,000 on it and your express exemption is actually $1,200, the creditor can sell the car and provide you $1,200. Some states allow 'Wildcard" exemptions that may be used to pay the difference.
+
 
+
* [[User:John|JE]] 2011-09-09: created project page
Knowing which bad debts are dischargeable and what the law allows a petitioner to keep, a rational choice may be made no matter if to document for bankruptcy. If you perform choose to report, there are numerous ways of going about it-in addition to several pitfalls to steer clear of.
+
* [[User:John|JE]] 2011-09-09: created project in svn
+
 
Swallowing Activity
+
== Notes for implementers ==
+
 
When you've decided to take motion you can begin the filing experience. If creditors are knocking on the door and repossession, foreclosure, or garnishment is just surrounding the comer, could actually always be wise to consider using a great urgent situation filing to obtain a helpful automatic stay. An automatic stay prevents creditors through taking any further measure till the case should go before a bankruptcy judge. Unlike a bankruptcy filing, which will contains several pages of info a helpful unexpected emergency filing is only one particular page longer and has got a report on your creditors. The rest of the petition must be filed within fourteen days or the case is actually dropped. The court will send notices with the pending bankruptcy to the creditors listed, who must cease almost all further collection actions. When they carry out not cease, send them copies of the automatic stay and request that all further assortment activity cease. A creditor can make sure you ask that the automatic stay become lifted, allowing your ex to continue series action. Only a landlord striving to evict you from a rented dwelling will typically prevail, unless there will be a lengthy-term lease involved. If you are renting on a prolonged-term lease, which could always be considered a good asset, the landlord may have to wait for a elegant @g to be able to evict YOU.
+
If you are interested in incorporating the ProgClub pcad into your project, here's what you need to know:
+
 
Once the wolves are at bay, another choice will should be made: if to find a bankruptcy legal professional. Attorneys, when all of us understand, are expensive. In the case of the complicated bankruptcy, nonetheless, they can be invaluable. If you have a reasonably bit of property or valuables, if you are seeking to move money coming from non-exempt to exempt assets, if your creditors try to make your financial obligations non-dischargeable because of fraud, or if there are any other complications, you may wish to use a helpful experienced bankruptcy lawyer. Go shopping in and around. Don'big t become scared to make a deal. Check a wide range of questions and speak to several attorneys before you make your choice.
+
Just copy and paste your way to victory for this one, I think. You might like to review the code before you use it, I haven't done much programming in C so there might be nasty buffer overflows or other bugs present.
 
If you have a very simple bankruptcy or can'capital t find the money for a good law firm, invest $15 in a good do-it-yourself bankruptcy book. It will provide in-depth details not covered in this specific chapter. Typing services am additionally available to type upwards bankruptcy forms. They're reasonably priced and, in the case of the very simple bankruptcy, can take the place of a helpful law firm. If your case is complicated so you can'n pay for a very legal professional, do your unique research. Read a customer bankruptcy manual first and after that confer with a good legal library. There are numerous legal guides devoted strictly to bankruptcy. Once you or your lawyer have prepared your case, you're ready for conventional deliver the results.
 
 
The Filing Procedure
 
 
Every single one the correct papers may be obtained through any bankruptcy court. Consult the yellow pages under Govt Services (normally in the start of the book) to have an address and mobile phone number. The court permits you fourteen days from the day of a good unexpected emergency filing to complete the official procedure. If Chapter 7 bankruptcy is truly being filed, you will need to send in the following forms after you have acquired them through the court:
 
 
· Statement of Economic Affairs.
 
 
· Plan of Current Income and Current Expenditures.
 
 
· A book explaining your debts.
 
 
· A routine talking about your property.
 
 
· A routine listing exempt property.
 
 
· A conclusion of the above schedules.
 
 
· Statement of Intention in regard to your secured property and what you intend to carry out with it
 
 
· Statement of Executory Contracts describing contract that will need to be fulfilled, this kind of as auto leases.
 
 
· Bankruptcy Petition write about sheet.
 
 
· Mailing addresses of all creditors.
 
 
· Any required nearby forms.
 
 
A fee will additionally become assessed, generally $90, due for the duration of filing. The court will typically accept installments of a four-month period. A great software for installments must accompany the petition.
 
 
After your petition will be filed, a visiting with the creditors are going to be set up. The court appoints a trustee to preside over the achieving and to become to blame for the liquidation of assets. With most smaller bankruptcies, only the man or woman filing and the trustee will participate in. The trustee, who can be quite a community law firm, will question several queries about the details on the bankruptcy documents. Contact and check the court clerk what papers you will need to carry (usually economic statements or sometimes even taxes delivers). In case a several property will be involved, incredibly if it is truly nonexempt, property, your creditors may appear to protest any exemptions. That they may furthermore attempt to grill you about your intent to pay the bill or about lying down on your application. Answer truthfully and there shouldn'n be a problem.
 
 
If the creditors' attorneys turn out to be abusive, demand a hearing before the bankruptcy judge before the proceeding should go any further. If the creditors object to any of your exemptions, they will have 30 days and nights after the creditor'ersus conference to record a good objection with the court. The court will book a hearing and you will then end up being offered the chance to respond, even though you don'big t have to. A creditor may additionally try to claim a debt because non-dischargeable because of fraudulent functions, a @ or malicious act, or embezzlement or theft. He can only accomplish it if he successfully raises the objection within sixty days from the creditors' visiting. To defend yourself, you or your legal professional will have to report a written response and end up being organized to argue your case in court.
 
 
Once almost all the requirements have been met and your intentions have been made clear, the court can declare the bankruptcy discharged. No official hearing will be held unless you have chosen to reaffirm your creditors which case the judge may wish to be sure that you simply understand what you are doing. After this time, provided the creditors do not raise any objections, the dischargeable debts are erased.
 
 
Selecting Upward The Pieces
 
 
Bankruptcy ended up being once the lowest disgrace that could befall someone. Today, nevertheless, it is commonplace. Corporations declare bankruptcy to get out of contracts or stay away from legal judgments. Individuals count on it to protect them coming from a society that extends credit way too quickly.
 
 
Bankruptcy doesn't imply that you simply will automatically always be denied most credit rating for 10 many years. In fact, many firms look at bankruptcy like a responsible way of discharging bad debts when there is truly no other way out. Creditors fear bankruptcy, nonetheless they even realize that if they lend to anyone who has expressed bankruptcy, they require not worry about another bankruptcy for seven a lot more many years (you can only report once every seven decades). If you happen to have a good explanation for the bankruptcy, this sort of like medical bills, separation and divorce, or some other catastrophic event, a creditor may end up being willing to overlook it and extend credit. Question potential creditors about their policy toward bankruptcies. Their responses may always be astonishing.
 
 
Darryl Power over 3 quite a few years in online marketing, 1 year in Pay-Per-Click on advertising and 7 decades of business management.
 
http://www.successfulbankruptcy.co.uk
 
http://crossriverchurch.com/index.php?/member/48599/
 

Latest revision as of 16:15, 11 December 2017

Pcad is the ProgClub administration daemon software. That's the software that does various administration things when a non-privileged user asks for them to be done. For example, it can recreate some MySQL databases on your behalf. For other projects see Projects.

Project status

Under way. Not released yet, there's stuff TODO.

Contributors

Members who have contributed to this project. Newest on top.

All contributors have agreed to the terms of the Contributor License Agreement. This excludes any upstream contributors who tend to have different administrative frameworks.

Copyright

Copyright 2011-2012, Contributors.

License

Licensed under the New BSD license.

Source code

The repository can be browsed online:

http://www.progclub.org/pcrepo/pcad/

The code for pcad is publicly available from svn:

http://www.progclub.org/svnro/pcrepo/pcad/tags/latest

Or privately available for read-write access:

https://www.progclub.org/svn/pcrepo/pcad/trunk/

Links

Functional specification

There are two components to this software, the client, and the server.

Pcad server

The server runs as a daemon process and listens on a TCP/IP port for incoming requests. It parses the requests to find the command. The command must correspond to an executable script in the /etc/pcad/command/ directory. If there is a matching command script then when the server gets a request for that command it runs the corresponding script as root.

Pcad client

The client is a Linux command that accepts a host, port and command. In the future maybe we'll also support command arguments, but that's not a goal for the first version. So the client might accept a command like this:

$ pcad-request localhost 12345 recreate-test-database

This would send the 'recreate-test-database' command to the pcad server running on the localhost. The server would then receive this command and process the script /etc/pcad/command/recreate-test-database. The pcad-request command blocks until the server has finished processing the request and returns an error level indicating success or error.

There will be another client command, pcad-async, which works the same way as pcad-request except that pcad-async does not block until completion of the command, rather it returns immediately after registering a command with the server, and the server will process the command in the background. The pcad-async command returns an error level indicating an error if the command is invalid, if the command is valid and accepted by the server then the error level is zero.

Thoughts

Maybe it would be better to give a host name to the client and then have the client lookup the host and port in a config file. For instance there might be a config file in /etc/pcad/client that looks like this:

localhost: localhost 12345

The client could then accept commands for localhost and lookup the host name in the config file to determine which server to connect to. This would simplify client code that needed to be reconfigured to use a different port.

Technical specification

The pcad client commands and the server will be implemented in C.

Pcad persistent daemon

The pcad server will run as a persistent daemon with something like the following in /etc/inittab

ad:12345:respawn:/usr/local/sbin/pcad-server

To force a reload of the inittab file by the init process:

# kill -HUP 1

Pcad network protocol

Request

A request is simply a line of text containing the execution type, followed by a space, followed by the name of the command. The supported execution types are "sync" and "async". So a stream that invoked the recreate-test-database command synchronously would use a network request that looked like this:

sync recreate-test-database

Or if it was an async request:

async recreate-test-database

Response

A response is a line of text containing the error level, e.g. 0 or 1. After the error level is any text returned on the standard output or standard error streams when the command was run. In the case of an async request the output can be either an error message or nothing.

Thoughts

There might be a problem with the network connection timing out for long running requests. If the network connection times out the client should return an error level indicating failure. It might be nice to have the server fire up a thread that outputs "." characters every second while the command is being processed. If we do that then the response protocol will have a line of zero or more dots, followed by a line indicating the error level, followed by any output.

Security

It might be best to run the pcad-server as a user 'pcad' rather than 'root'. This can be done using sudo in the inittab, e.g.

ad:12345:respawn:/usr/bin/sudo -u pcad /usr/local/sbin/pcad-server

The pcad-server would then need to have permission to launch its command scripts as root. This can be accomplished by running the visudo command and adding a line such as the following:

pcad localhost=/etc/pcad/command/*

If we do it this way the server will need to support executing scripts with sudo. We'd also need to make sure that the pcad user didn't have write access to the /etc/pcad/command/ directory.

TODO

Things to do, in rough order of priority:

  • Make the executable code run forever
  • Make the executable a managed daemon process that gets started and stopped properly
  • Add support from recreating pcphpjs-dev database

Done

Stuff that's done. Latest stuff on top.

  • JE 2011-09-09: created project page
  • JE 2011-09-09: created project in svn

Notes for implementers

If you are interested in incorporating the ProgClub pcad into your project, here's what you need to know:

Just copy and paste your way to victory for this one, I think. You might like to review the code before you use it, I haven't done much programming in C so there might be nasty buffer overflows or other bugs present.