(Adds details throughout)

Jan 19 (Reuters) - President Donald Trump and the U.S. Congress are racing to meet a midnight Friday deadline to pass a short-term bill to keep the U.S. government open and prevent agencies from shutting down.

In shutdowns, government employees are vulnerable to furlough, or temporary unpaid leave. Other “essential” workers, including those dealing with public safety and national security, keep working, some with and others without pay.

After previous government shutdowns, Congress passed measures to ensure that essential and nonessential employees received retroactive pay.

The last shutdown in October 2013 lasted more than two weeks. More than 800,000 federal employees were furloughed. Here is what happened then and some recent updates from officials:

MILITARY: The Defense Department said on Friday that a shutdown would not impact the U.S. military’s war in Afghanistan or its operations against Islamist militants in Iraq and Syria. All military personnel on active duty would remain on normal duty status. Civilian personnel in non-essential operations would be furloughed.

JUSTICE: The Justice Department has many “essential” workers. Under its shutdown contingency plan, about 95,000 of the department’s almost 115,000 staff would keep working.

FINANCIAL OVERSIGHT: The stock market-policing Securities and Exchange Commission funds itself by collecting fees from the financial industry but its budget is set by Congress. It has said in the past it would be able to continue operations temporarily in a shutdown. But it would have to furlough workers if Congress went weeks before approving new funding.

The Commodity Futures Trading Commission, meanwhile, would have to furlough 95 percent of its employees immediately. An agency spokeswoman said the derivatives regulator could call in additional staff, however, in the event of financial market emergency.

NATIONAL PARKS: National parks closed in 2013 and it resulted in a loss of 750,000 daily visitors, said the nonprofit National Parks Conservation Association. The National Park Service (NPS) estimated the shutdown cost $500 million in lost visitor spending in areas around the parks and the Smithsonian museums.

WASHINGTON TOURIST SIGHTS: In 2013, popular tourist sites such as the Smithsonian closed, with barricades going up at the Lincoln Memorial, the Library of Congress and the National Archives. The National Zoo closed and its popular “Panda Cam” went dark. The NPS, which oversees many Washington landmarks, including the National Mall, has said it has a plan in place so that “First Amendment activities” can continue during a shutdown.

TAXES: The Internal Revenue Service furloughed 90 percent of its staff in 2013, the liberal Center for American Progress said. About $4 billion in tax refunds were delayed as a result, according to the Office of Management and Budget, or OMB.

MAIL DELIVERY: Deliveries are expected to continue as usual because the U.S. Postal Service gets no tax dollars for day-to-day operations.

TRAVEL: Air and rail travelers did not feel a big impact in 2013 because security officers and air traffic controllers remained at work. Passport processing continued with some delays.

COURTS: The Administrative Office of the U.S. Courts has said federal courts, including the Supreme Court, could continue to operate normally for about three weeks without additional funding.

HEALTHCARE: Sign-ups for the newly created Obamacare health insurance exchanges began as scheduled in 2013. The Medicare health insurance program for the elderly continued largely without disruption. A program at the U.S. Centers for Disease Control and Prevention to track flu outbreaks was temporarily halted. Hundreds of patients could not enroll in National Institutes of Health clinical trials, according to the OMB.

CHILDREN: Six Head Start programs in Alabama, Connecticut, Florida, Georgia, Mississippi and South Carolina serving about 6,300 children shut for nine days, the OMB said.

SOCIAL SECURITY: Social Security and disability checks were issued in 2013 with no change in payment dates and field offices remained open but offered limited services. There were delays in the review process for new applicants.

LOANS: Processing of mortgages and other loans was delayed when lenders could not access government services such as income and Social Security number verification. The Small Business Administration was unable to process about 700 applications for $140 million in loans until the shutdown ended, OMB said.

VETERANS: Most employees at the Department of Veterans Affairs would not be subject to furlough. VA hospitals would remain open and veterans’ benefits would continue, but education assistance and case appeals would be delayed, the department said.

FOOD INSPECTIONS: Department of Agriculture meat inspectors stayed on the job. Agricultural statistical reports ceased publication. The USDA’s website went dark.

ENERGY: The Department of Energy said on Friday that since most of its appropriations are for multiple years, employees should report to work as normal during a shutdown until told otherwise. If there was a prolonged lapse in funding a “limited number” of workers may be placed on furlough, according to its plan. (Reporting by Suzannah Gonzales in Chicago, Amanda Becker, Sarah N. Lynch and Mary Milliken in Washington; Editing by Peter Cooney, Bill Trott and Susan Thomas)